Unverified Commit a752c2f1 authored by Callum Moffat's avatar Callum Moffat Committed by GitHub

Expose enableIMEPersonalizedLearning on CupertinoSearchTextField (#119439)

parent 3894d248
......@@ -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);
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment