Robert Flesch
Robert Flesch

Reputation: 116

Unable to hide text underline in TextFormField

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

Upvotes: 1

Views: 176

Answers (2)

viniciusbaca
viniciusbaca

Reputation: 306

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",
    )
)

Upvotes: 1

Krishna
Krishna

Reputation: 38

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

Upvotes: 0

Related Questions