I'm implementing a login screen in Flutter and I cannot set the Content-Type on an email text field. On an iOS app, the content type needs to be set in order for email addresses suggestions to display while editing.
Am I missing something or is this not yet supported?
TextFormField(
maxLines: 1,
keyboardAppearance: Brightness.light,
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
focusNode: _emailFocus,
autofocus: true,
decoration: InputDecoration(
hintText: 'Email',
icon: Icon(
Icons.mail,
color: Colors.grey,
),
),
validator: (value) => value.isEmpty ? "Email can't be empty" : null,
onSaved: (value) => _email = value.trim(),
onFieldSubmitted: (term) => _fieldFocusChange(context, _emailFocus, _passwordFocus),
)
There is an option for this in Xcode:
One is TextField and the other one is TextFormField , a slightly more advanced version of TextField . TextFormField provides more functionalities than TextField , such as build form validation and the ability to set initial text value directly.
There is a keyboardType
new TextFormField
(
keyboardType: TextInputType.emailAddress
...
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With