How to remove underline below TextField?
Try to give a TextStyle to your TextField widget. Your TextField is getting your default Theme's TextStyle.
TextField( autofocus: true, style: TextStyle(color: Colors.white, fontSize: 30), decoration: InputDecoration.collapsed( hintText: "Search", border: InputBorder.none, ), maxLines: 1, )
In TextField widgets source code it states:
/// If null, defaults to the `subhead` text style from the current [Theme]. final TextStyle style;
I suspect it's something to do with the predictive text. The underlines disappear when you press the space bar to end the word you're typing; they then start appearing again when you start typing the next word. As suggested here, try setting TextInputType.visiblePassword; - this worked for me.