Unverified Commit 318f8758 authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Pass through magnifierConfiguration (#118270)

parent 351466ae
......@@ -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));
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment