This reverts commit 9407700aa4a843885d7acca324773f85e3766743.
This commit is contained in:
parent
919d20511c
commit
0acfb216ac
@ -3150,7 +3150,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
ReplaceTextIntent: _replaceTextAction,
|
ReplaceTextIntent: _replaceTextAction,
|
||||||
UpdateSelectionIntent: _updateSelectionAction,
|
UpdateSelectionIntent: _updateSelectionAction,
|
||||||
DirectionalFocusIntent: DirectionalFocusAction.forTextField(),
|
DirectionalFocusIntent: DirectionalFocusAction.forTextField(),
|
||||||
DismissIntent: CallbackAction<DismissIntent>(onInvoke: (_) => hideToolbar(false)),
|
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
DeleteCharacterIntent: _makeOverridable(_DeleteTextAction<DeleteCharacterIntent>(this, _characterBoundary)),
|
DeleteCharacterIntent: _makeOverridable(_DeleteTextAction<DeleteCharacterIntent>(this, _characterBoundary)),
|
||||||
|
@ -1316,41 +1316,6 @@ void main() {
|
|||||||
expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget);
|
expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('can hide toolbar with DismissIntent', (WidgetTester tester) async {
|
|
||||||
await tester.pumpWidget(
|
|
||||||
MaterialApp(
|
|
||||||
home: EditableText(
|
|
||||||
backgroundCursorColor: Colors.grey,
|
|
||||||
controller: controller,
|
|
||||||
focusNode: focusNode,
|
|
||||||
style: textStyle,
|
|
||||||
cursorColor: cursorColor,
|
|
||||||
selectionControls: materialTextSelectionControls,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
final EditableTextState state =
|
|
||||||
tester.state<EditableTextState>(find.byType(EditableText));
|
|
||||||
|
|
||||||
// Show the toolbar
|
|
||||||
state.renderEditable.selectWordsInRange(
|
|
||||||
from: Offset.zero,
|
|
||||||
cause: SelectionChangedCause.tap,
|
|
||||||
);
|
|
||||||
await tester.pump();
|
|
||||||
|
|
||||||
// On web, we don't let Flutter show the toolbar.
|
|
||||||
expect(state.showToolbar(), kIsWeb ? isFalse : isTrue);
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
expect(find.text('Paste'), kIsWeb ? findsNothing : findsOneWidget);
|
|
||||||
|
|
||||||
// Hide the menu using the DismissIntent.
|
|
||||||
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
|
|
||||||
await tester.pump();
|
|
||||||
expect(find.text('Paste'), findsNothing);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('Paste is shown only when there is something to paste', (WidgetTester tester) async {
|
testWidgets('Paste is shown only when there is something to paste', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user