add email to the text fields demo (#13946)

This commit is contained in:
xster
2018-01-08 16:57:52 -08:00
committed by GitHub
parent 4954bbfaf9
commit 0f11de2e06

View File

@@ -19,6 +19,7 @@ class TextFormFieldDemo extends StatefulWidget {
class PersonData {
String name = '';
String phoneNumber = '';
String email = '';
String password = '';
}
@@ -144,6 +145,15 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
_phoneNumberFormatter,
],
),
new TextFormField(
decoration: const InputDecoration(
icon: const Icon(Icons.email),
hintText: 'Your email address',
labelText: 'E-mail',
),
keyboardType: TextInputType.emailAddress,
onSaved: (String value) { person.email = value; },
),
new TextFormField(
decoration: const InputDecoration(
hintText: 'Tell us about yourself',