This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 2 files changed +23
-0
lines changed
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> {
154
154
bool enableIMEPersonalizedLearning = true ,
155
155
MouseCursor ? mouseCursor,
156
156
EditableTextContextMenuBuilder ? contextMenuBuilder = _defaultContextMenuBuilder,
157
+ TextMagnifierConfiguration ? magnifierConfiguration,
157
158
}) : assert (initialValue == null || controller == null ),
158
159
assert (obscuringCharacter.length == 1 ),
159
160
assert (maxLines == null || maxLines > 0 ),
@@ -234,6 +235,7 @@ class TextFormField extends FormField<String> {
234
235
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
235
236
mouseCursor: mouseCursor,
236
237
contextMenuBuilder: contextMenuBuilder,
238
+ magnifierConfiguration: magnifierConfiguration,
237
239
),
238
240
);
239
241
},
Original file line number Diff line number Diff line change @@ -1148,4 +1148,25 @@ void main() {
1148
1148
variant: TargetPlatformVariant .all (),
1149
1149
skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web.
1150
1150
);
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
+ });
1151
1172
}
You can’t perform that action at this time.
0 commit comments