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.

4
  • can you share what about your _code and codeController, I comment out this two and then working fine Commented Aug 4, 2021 at 4: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 Commented Aug 4, 2021 at 4:17
  • Your code working correctly . if any problem go to my answer here stackoverflow.com/a/68645258/13997210 Commented Aug 4, 2021 at 4: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 Commented Aug 4, 2021 at 4:20

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.