Expose enableIMEPersonalizedLearning on CupertinoSearchTextField (#119439)
This commit is contained in:
@@ -122,6 +122,7 @@ class CupertinoSearchTextField extends StatefulWidget {
|
||||
this.focusNode,
|
||||
this.smartQuotesType,
|
||||
this.smartDashesType,
|
||||
this.enableIMEPersonalizedLearning = true,
|
||||
this.autofocus = false,
|
||||
this.onTap,
|
||||
this.autocorrect = true,
|
||||
@@ -311,6 +312,9 @@ class CupertinoSearchTextField extends StatefulWidget {
|
||||
/// * <https://developer.apple.com/documentation/uikit/uitextinputtraits>
|
||||
final SmartDashesType? smartDashesType;
|
||||
|
||||
/// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
|
||||
final bool enableIMEPersonalizedLearning;
|
||||
|
||||
/// Disables the text field when false.
|
||||
///
|
||||
/// Text fields in disabled states have a light grey background and don't
|
||||
@@ -453,6 +457,7 @@ class _CupertinoSearchTextFieldState extends State<CupertinoSearchTextField>
|
||||
autocorrect: widget.autocorrect,
|
||||
smartQuotesType: widget.smartQuotesType,
|
||||
smartDashesType: widget.smartDashesType,
|
||||
enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
|
||||
textInputAction: TextInputAction.search,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -624,4 +624,19 @@ void main() {
|
||||
final CupertinoTextField textField = tester.widget(find.byType(CupertinoTextField));
|
||||
expect(textField.smartDashesType, SmartDashesType.disabled);
|
||||
});
|
||||
|
||||
testWidgets('enableIMEPersonalizedLearning is properly forwarded to the inner text field', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const CupertinoApp(
|
||||
home: Center(
|
||||
child: CupertinoSearchTextField(
|
||||
enableIMEPersonalizedLearning: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final CupertinoTextField textField = tester.widget(find.byType(CupertinoTextField));
|
||||
expect(textField.enableIMEPersonalizedLearning, false);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user