Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save truongsinh/b965355bd8804607bc5fb52df07a4b51 to your computer and use it in GitHub Desktop.
Save truongsinh/b965355bd8804607bc5fb52df07a4b51 to your computer and use it in GitHub Desktop.
AutofillGroup to autofill multiple fields in one tap
diff --git a/lib/main.dart b/lib/main.dart
index ae75939..4f1704b 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -33,6 +33,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
@override
Widget build(BuildContext context) => ListView(
padding: EdgeInsets.symmetric(horizontal: 16),
+ children: [
+ AutofillGroup(
+ child: Column(
children: [
TextFormField(
autofillHints: [AutofillHints.streetAddressLine1],
@@ -48,6 +51,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
hintText: '(optional) APT number, c/o',
),
),
+ ],
+ ),
+ ),
CheckboxListTile(
contentPadding: EdgeInsets.zero,
title: const Text("Billing address same as shipping address"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment