Pass through magnifierConfiguration (#118270)
This commit is contained in:
committed by
GitHub
parent
351466aea6
commit
318f8758ba
@@ -154,6 +154,7 @@ class TextFormField extends FormField<String> {
|
||||
bool enableIMEPersonalizedLearning = true,
|
||||
MouseCursor? mouseCursor,
|
||||
EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
|
||||
TextMagnifierConfiguration? magnifierConfiguration,
|
||||
}) : assert(initialValue == null || controller == null),
|
||||
assert(obscuringCharacter.length == 1),
|
||||
assert(maxLines == null || maxLines > 0),
|
||||
@@ -234,6 +235,7 @@ class TextFormField extends FormField<String> {
|
||||
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
|
||||
mouseCursor: mouseCursor,
|
||||
contextMenuBuilder: contextMenuBuilder,
|
||||
magnifierConfiguration: magnifierConfiguration,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1148,4 +1148,25 @@ void main() {
|
||||
variant: TargetPlatformVariant.all(),
|
||||
skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web.
|
||||
);
|
||||
|
||||
testWidgets('magnifierConfiguration passes through to EditableText', (WidgetTester tester) async {
|
||||
final TextMagnifierConfiguration myTextMagnifierConfiguration = TextMagnifierConfiguration(
|
||||
magnifierBuilder: (BuildContext context, MagnifierController controller, ValueNotifier<MagnifierInfo> notifier) {
|
||||
return const Placeholder();
|
||||
},
|
||||
);
|
||||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: TextField(
|
||||
magnifierConfiguration: myTextMagnifierConfiguration,
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
expect(find.byType(EditableText), findsOneWidget);
|
||||
|
||||
final EditableText editableText = tester.widget(find.byType(EditableText));
|
||||
expect(editableText.magnifierConfiguration, equals(myTextMagnifierConfiguration));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user