Unverified Commit 07f9563d authored by Pedro Massango's avatar Pedro Massango Committed by GitHub

Add autofill support for TextFormField (#57332)

parent e8a7dc46
......@@ -174,6 +174,7 @@ class TextFormField extends FormField<String> {
bool enableInteractiveSelection = true,
InputCounterWidgetBuilder buildCounter,
ScrollPhysics scrollPhysics,
Iterable<String> autofillHints,
}) : assert(initialValue == null || controller == null),
assert(textAlign != null),
assert(autofocus != null),
......@@ -257,6 +258,7 @@ class TextFormField extends FormField<String> {
keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: enableInteractiveSelection,
buildCounter: buildCounter,
autofillHints: autofillHints,
);
},
);
......
......@@ -425,4 +425,21 @@ void main() {
expect(find.text('initialValue'), findsNothing);
expect(find.text('changedValue'), findsOneWidget);
});
testWidgets('autofillHints is passed to super', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: Material(
child: Center(
child: TextFormField(
autofillHints: const <String>[AutofillHints.countryName],
),
),
),
),
);
final TextField widget = tester.widget(find.byType(TextField));
expect(widget.autofillHints, equals(const <String>[AutofillHints.countryName]));
});
}
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