Reputation: 120529
I'm using Flutter, and I'm building a login screen. The default behavior of the keyboard on iOS seems to auto-uppercase the initial character. I'd like to turn that off. How do I do it?
Upvotes: 3
Views: 2750
Reputation: 157
iOS auto-capitalizes the first letter when a word is a proper noun, e.g. Matt or Brazil.
So, when you type a dot in an email address, you are effectively creating a word and iOS wants to "correct" it.
You can turn this off with
autocorrect: false
in a TextField
or TextFormField
widget.
Upvotes: 3
Reputation: 8303
Capitalization in text fields is now disabled by default and can be configured via textCapitalization
property:
import 'package:flutter/services.dart';
TextField(...
textCapitalization: TextCapitalization.words
..)
Upvotes: 2
Reputation: 116728
The UITextAutocapitalizationType
is set in FlutterTextInputPlugin
. Currently it isn't configurable and it defaults to UITextAutocapitalizationTypeSentences
if the type of the field is TextInputType.text
and UITextAutocapitalizationTypeNone
otherwise.
So basically, you can change the text input type to TextInputType.emailAddress
or TextInputType.url
and it won't be capitalized. If that isn't enough configurability for you, you'd have to change the Flutter engine.
Upvotes: 1