Working on my first flutter app. The main app screen doesn't have this issue, all the texts show up as they should.
However in this new screen I'm developing, all the text widget have some weird yellow line / double-line underneath.
Any ideas on why this is happening?
By setting the decoration argument of TextStyle to TextDecoration. none, you can remove the yellow lines as well.
Why Flutter displays Yellow lines? The problem is not having a Scaffold Widget. A Scaffold is a helper for Material apps like AppBar, Drawer.
softWrap. Whether the text should break at soft line breaks. If false, the glyphs in the text will be positioned as if there was unlimited horizontal space.
The problem is having a Scaffold
or not. Scaffold
is a helper for Material
apps (AppBar
, Drawer
, that sort of stuff). But you're not forced to use Material
.
What you're missing is an instance of DefaultTextStyle
as a parent:
DefaultTextStyle( style: TextStyle(...), child: Text('Hello world'), )
Various widgets add one to change the default text theme, such as Scaffold, Dialog, AppBar, ListTile, ...
It's DefaultTextStyle
that allows your app-bar title to be bold by default for example.
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