@@ -6585,6 +6585,7 @@ void main() {
65856585 'TextInput.setStyle' ,
65866586 'TextInput.setEditingState' ,
65876587 'TextInput.show' ,
6588+ 'TextInput.requestAutofill' ,
65886589 'TextInput.setEditingState' ,
65896590 'TextInput.show' ,
65906591 'TextInput.setCaretRect' ,
@@ -6648,6 +6649,7 @@ void main() {
66486649 'TextInput.setStyle' ,
66496650 'TextInput.setEditingState' ,
66506651 'TextInput.show' ,
6652+ 'TextInput.requestAutofill' ,
66516653 'TextInput.setCaretRect' ,
66526654 ];
66536655 expect (
@@ -6690,6 +6692,7 @@ void main() {
66906692 'TextInput.setStyle' ,
66916693 'TextInput.setEditingState' ,
66926694 'TextInput.show' ,
6695+ 'TextInput.requestAutofill' ,
66936696 'TextInput.setEditingState' ,
66946697 'TextInput.show' ,
66956698 'TextInput.setCaretRect' ,
@@ -6740,6 +6743,7 @@ void main() {
67406743 'TextInput.setStyle' ,
67416744 'TextInput.setEditingState' ,
67426745 'TextInput.show' ,
6746+ 'TextInput.requestAutofill' ,
67436747 'TextInput.setEditingState' ,
67446748 'TextInput.show' ,
67456749 'TextInput.setCaretRect' ,
@@ -8974,6 +8978,53 @@ void main() {
89748978 await tester.pump ();
89758979 expect (scrollController.offset.roundToDouble (), 0.0 );
89768980 });
8981+
8982+ testWidgets ('Autofill enabled by default' , (WidgetTester tester) async {
8983+ final FocusNode focusNode = FocusNode ();
8984+ await tester.pumpWidget (
8985+ MaterialApp (
8986+ home: EditableText (
8987+ autofocus: true ,
8988+ controller: TextEditingController (text: 'A' ),
8989+ focusNode: focusNode,
8990+ style: textStyle,
8991+ cursorColor: Colors .blue,
8992+ backgroundCursorColor: Colors .grey,
8993+ cursorOpacityAnimates: true ,
8994+ ),
8995+ ),
8996+ );
8997+
8998+ assert (focusNode.hasFocus);
8999+ expect (
9000+ tester.testTextInput.log,
9001+ contains (matchesMethodCall ('TextInput.requestAutofill' )),
9002+ );
9003+ });
9004+
9005+ testWidgets ('Autofill can be disabled' , (WidgetTester tester) async {
9006+ final FocusNode focusNode = FocusNode ();
9007+ await tester.pumpWidget (
9008+ MaterialApp (
9009+ home: EditableText (
9010+ autofocus: true ,
9011+ controller: TextEditingController (text: 'A' ),
9012+ focusNode: focusNode,
9013+ style: textStyle,
9014+ cursorColor: Colors .blue,
9015+ backgroundCursorColor: Colors .grey,
9016+ cursorOpacityAnimates: true ,
9017+ autofillHints: null ,
9018+ ),
9019+ ),
9020+ );
9021+
9022+ assert (focusNode.hasFocus);
9023+ expect (
9024+ tester.testTextInput.log,
9025+ isNot (contains (matchesMethodCall ('TextInput.requestAutofill' ))),
9026+ );
9027+ });
89779028}
89789029
89799030class UnsettableController extends TextEditingController {
0 commit comments