Skip to content

Instantly share code, notes, and snippets.

@truongsinh
Last active August 6, 2020 01:28
Show Gist options
  • Save truongsinh/0ff2f22f16aee3cb950e3519413c19cf to your computer and use it in GitHub Desktop.
Save truongsinh/0ff2f22f16aee3cb950e3519413c19cf to your computer and use it in GitHub Desktop.
first field(s) to have autofill
diff --git a/lib/main.dart b/lib/main.dart
index 1460ece..ae75939 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -35,12 +35,14 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
padding: EdgeInsets.symmetric(horizontal: 16),
children: [
TextFormField(
+ autofillHints: [AutofillHints.streetAddressLine1],
decoration: const InputDecoration(
labelText: 'Shipping address 1',
hintText: 'Number and street',
),
),
TextFormField(
+ autofillHints: [AutofillHints.streetAddressLine2],
decoration: const InputDecoration(
labelText: 'Shipping address 2',
hintText: '(optional) APT number, c/o',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment