Here is the code. I want to remove the black underline just below text, and currently the TextField is in edit mode:
TextField( autofocus: true, decoration: InputDecoration.collapsed( hintText: "Search", border: InputBorder.none, ), maxLines: 1, )
To remove underline from input component with React Material UI, we can set the disableUnderline prop to true . to add the disableUnderline to the Input component. As a result, we wouldn't see the underline of the input now.
The underline can be easily remove by using text-decoration property. The text-decoration property of CSS allows to decorate the text according to requirement. By setting the text-decoration to none to remove the underline from anchor tag.
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;
You should use TextDecoration.none
in decoration
property.
Text( 'your txt', style: TextStyle( decoration: TextDecoration.none), )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With