File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ class CupertinoSearchTextField extends StatefulWidget {
122122 this .focusNode,
123123 this .smartQuotesType,
124124 this .smartDashesType,
125+ this .enableIMEPersonalizedLearning = true ,
125126 this .autofocus = false ,
126127 this .onTap,
127128 this .autocorrect = true ,
@@ -311,6 +312,9 @@ class CupertinoSearchTextField extends StatefulWidget {
311312 /// * <https://developer.apple.com/documentation/uikit/uitextinputtraits>
312313 final SmartDashesType ? smartDashesType;
313314
315+ /// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
316+ final bool enableIMEPersonalizedLearning;
317+
314318 /// Disables the text field when false.
315319 ///
316320 /// Text fields in disabled states have a light grey background and don't
@@ -453,6 +457,7 @@ class _CupertinoSearchTextFieldState extends State<CupertinoSearchTextField>
453457 autocorrect: widget.autocorrect,
454458 smartQuotesType: widget.smartQuotesType,
455459 smartDashesType: widget.smartDashesType,
460+ enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
456461 textInputAction: TextInputAction .search,
457462 );
458463 }
Original file line number Diff line number Diff line change @@ -624,4 +624,19 @@ void main() {
624624 final CupertinoTextField textField = tester.widget (find.byType (CupertinoTextField ));
625625 expect (textField.smartDashesType, SmartDashesType .disabled);
626626 });
627+
628+ testWidgets ('enableIMEPersonalizedLearning is properly forwarded to the inner text field' , (WidgetTester tester) async {
629+ await tester.pumpWidget (
630+ const CupertinoApp (
631+ home: Center (
632+ child: CupertinoSearchTextField (
633+ enableIMEPersonalizedLearning: false ,
634+ ),
635+ ),
636+ ),
637+ );
638+
639+ final CupertinoTextField textField = tester.widget (find.byType (CupertinoTextField ));
640+ expect (textField.enableIMEPersonalizedLearning, false );
641+ });
627642}
You can’t perform that action at this time.
0 commit comments