This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 2 files changed +20
-0
lines changed
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 {
122
122
this .focusNode,
123
123
this .smartQuotesType,
124
124
this .smartDashesType,
125
+ this .enableIMEPersonalizedLearning = true ,
125
126
this .autofocus = false ,
126
127
this .onTap,
127
128
this .autocorrect = true ,
@@ -311,6 +312,9 @@ class CupertinoSearchTextField extends StatefulWidget {
311
312
/// * <https://developer.apple.com/documentation/uikit/uitextinputtraits>
312
313
final SmartDashesType ? smartDashesType;
313
314
315
+ /// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
316
+ final bool enableIMEPersonalizedLearning;
317
+
314
318
/// Disables the text field when false.
315
319
///
316
320
/// Text fields in disabled states have a light grey background and don't
@@ -453,6 +457,7 @@ class _CupertinoSearchTextFieldState extends State<CupertinoSearchTextField>
453
457
autocorrect: widget.autocorrect,
454
458
smartQuotesType: widget.smartQuotesType,
455
459
smartDashesType: widget.smartDashesType,
460
+ enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
456
461
textInputAction: TextInputAction .search,
457
462
);
458
463
}
Original file line number Diff line number Diff line change @@ -624,4 +624,19 @@ void main() {
624
624
final CupertinoTextField textField = tester.widget (find.byType (CupertinoTextField ));
625
625
expect (textField.smartDashesType, SmartDashesType .disabled);
626
626
});
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
+ });
627
642
}
You can’t perform that action at this time.
0 commit comments