Seth Ladd
Seth Ladd

Reputation: 120529

Turning off the auto-capitalization of the initial character of the keyboard in iOS? Flutter

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

Answers (3)

Knoxy
Knoxy

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

jibiel
jibiel

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
..)

@dmjones, flutter/flutter

Upvotes: 2

Collin Jackson
Collin Jackson

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

Related Questions