This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ class TextFormField extends FormField<String> {
154154 bool enableIMEPersonalizedLearning = true ,
155155 MouseCursor ? mouseCursor,
156156 EditableTextContextMenuBuilder ? contextMenuBuilder = _defaultContextMenuBuilder,
157+ TextMagnifierConfiguration ? magnifierConfiguration,
157158 }) : assert (initialValue == null || controller == null ),
158159 assert (obscuringCharacter.length == 1 ),
159160 assert (maxLines == null || maxLines > 0 ),
@@ -234,6 +235,7 @@ class TextFormField extends FormField<String> {
234235 enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
235236 mouseCursor: mouseCursor,
236237 contextMenuBuilder: contextMenuBuilder,
238+ magnifierConfiguration: magnifierConfiguration,
237239 ),
238240 );
239241 },
Original file line number Diff line number Diff line change @@ -1148,4 +1148,25 @@ void main() {
11481148 variant: TargetPlatformVariant .all (),
11491149 skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web.
11501150 );
1151+
1152+ testWidgets ('magnifierConfiguration passes through to EditableText' , (WidgetTester tester) async {
1153+ final TextMagnifierConfiguration myTextMagnifierConfiguration = TextMagnifierConfiguration (
1154+ magnifierBuilder: (BuildContext context, MagnifierController controller, ValueNotifier <MagnifierInfo > notifier) {
1155+ return const Placeholder ();
1156+ },
1157+ );
1158+
1159+ await tester.pumpWidget (MaterialApp (
1160+ home: Scaffold (
1161+ body: TextField (
1162+ magnifierConfiguration: myTextMagnifierConfiguration,
1163+ ),
1164+ ),
1165+ ));
1166+
1167+ expect (find.byType (EditableText ), findsOneWidget);
1168+
1169+ final EditableText editableText = tester.widget (find.byType (EditableText ));
1170+ expect (editableText.magnifierConfiguration, equals (myTextMagnifierConfiguration));
1171+ });
11511172}
You can’t perform that action at this time.
0 commit comments