Unable to hide text underline in TextFormField

178 views Asked by At

I am trying to hide the underline of the entered text when using the TextFormField. I have read all of the suggestions, but none of them eliminate the underline!

child: TextFormField(
  autocorrect: false, 
  inputFormatters: [ new FilteringTextInputFormatter.allow(RegExp("[a-zA-Z0-9]"))],
  textAlign: TextAlign.center,
  decoration: InputDecoration(
     hintText: "i.e. noahsclearnews",
     hintStyle: TextStyle( color: Colors.grey, fontSize: ScreenUtil().setSp(40) ),
     border: InputBorder.none,
     focusedBorder: InputBorder.none,
     enabledBorder: InputBorder.none,
     errorBorder: InputBorder.none,
     disabledBorder: InputBorder.none,
  )
)

Am I missing something?

Sample screenshot

2

There are 2 answers

2
viniciusbaca On BEST ANSWER

That's a native underline when you are typing unknown words in your keyboard independently of the FormField, actually isn't a thing in your app but in the android keyboard.

But you can ignore those corrections setting the keyboardType as a TextInputType.visiblePassword.

TextFormField(
    autocorrect: false,
    keyboardType: TextInputType.visiblePassword, // Disabling word correction
    decoration: InputDecoration(
      hintText: "i.e. noahsclearnews",
    )
)
1
Krishna On

Maybe a space would work , give a space while writing and ur underline will be removed