Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPPERCASE keyboard in an OTPTextField widget #50

Open
PrasadDhend opened this issue Apr 8, 2023 · 0 comments
Open

UPPERCASE keyboard in an OTPTextField widget #50

PrasadDhend opened this issue Apr 8, 2023 · 0 comments

Comments

@PrasadDhend
Copy link

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

No branches or pull requests

1 participant