How can I force the TextFormField to only have uppercase letters ? textCapitalization: TextCapitalization.characters lets the user switch back to lowercase, so it isn't sufficient for what I want.
add textInputFormatter to text field
TextField(inputFormatters: [UpperCaseTextFormatter()]),
formatter class
class UpperCaseTextFormatter extends TextInputFormatter {
  @override
  TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
    return TextEditingValue(text: newValue.text.toUpperCase(), selection: newValue.selection);
  }
}
                        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