0

So my TextFormField is just showing 1 character when it is typed but when the character was deleted and retyped it didn't show anything, but the value was shown on the keyboard recommendations.

Heres my TextFormField code:

Form(
  key: _code,
  child: TextFormField(
    controller: codeController,
    decoration: InputDecoration(
      fillColor: Colors.transparent,
      filled: true,
      labelText: 'Kode Akses',
      labelStyle: TextStyle(color: Colors.black),
      focusedBorder: OutlineInputBorder(
        borderRadius: BorderRadius.all(Radius.circular(5.0)),
        borderSide: BorderSide(color: Colors.black),
      ),
      border: OutlineInputBorder(
        borderRadius: BorderRadius.circular(10),
        borderSide:BorderSide(color: Colors.black, width: 30.sp),
      ),
      focusColor: Colors.red,
    ),
    inputFormatters: [UpperCaseTextFormatter()],
  ),
),

Error happened

Here I typed YOU but it doesn't show anything in the TextFormField.

As I discovered, the value isn't got inside the TextFormField so,for anything I type, the value isn't fill in the TextFormField.

Valentin Vignal
  • 6,151
  • 2
  • 33
  • 73
Caramel
  • 111
  • 7
  • can you share what about your _code and codeController, I comment out this two and then working fine – Jahidul Islam Aug 04 '21 at 04:09
  • 1
    @JahidulIslam I just figure it out, the controller has no relation in it, it happened because of this code `inputFormatters: [UpperCaseTextFormatter()]`, in the iOS emulator it work just fine, but when it used on Real Android phone it just dont insert the value – Caramel Aug 04 '21 at 04:17
  • Your code working correctly . if any problem go to my answer here https://stackoverflow.com/a/68645258/13997210 – Ravindra S. Patil Aug 04 '21 at 04:18
  • @RavindraS.Patil it does work fine on my iOS emulator but not on my Android phone, btw Thank You for trying to help, also i tried your solutions but it doesnt seem to work on my iOS emulator but it does work on my android phone – Caramel Aug 04 '21 at 04:20

1 Answers1

1

Remove inputFormatters: [UpperCaseTextFormatter()] code, and change it to textCapitalization: TextCapitalization.characters,

Caramel
  • 111
  • 7