Skip to content

UPPERCASE keyboard in an OTPTextField widget #50#51

Open
PrasadDhend wants to merge 2 commits into
iamvivekkaushik:masterfrom
PrasadDhend:master
Open

UPPERCASE keyboard in an OTPTextField widget #50#51
PrasadDhend wants to merge 2 commits into
iamvivekkaushik:masterfrom
PrasadDhend:master

Conversation

@PrasadDhend
Copy link
Copy Markdown

If I want to use an uppercase keyboard in an OTPTextField widget in Flutter, I can use the textInputAction and textCapitalization properties to customize the keyboard behavior. Here's an example:

OTPTextField(
  length: 6,
  width: MediaQuery.of(context).size.width,
  fieldWidth: 50,
  style: TextStyle(fontSize: 20),
  textFieldAlignment: MainAxisAlignment.spaceAround,
  fieldStyle: FieldStyle.underline,
  onCompleted: (pin) {
    // Do something with the entered OTP.
  },
  textInputAction: TextInputAction.done,
  textCapitalization: TextCapitalization.characters,
),

In the above example, the textInputAction property is set to TextInputAction.done, which will display a "Done" button on the keyboard, and the textCapitalization property is set to TextCapitalization.characters, which will force the keyboard to display uppercase letters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant