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
There is an other solution for this , especially if you are using multiple pages wrapped under main.dart file You can do something like this:
child: MaterialApp(
home: Material(child: Wrapper()),
),
This will remove the yellow lines under text that is present in any pages referenced/used under wrapper.
Also you can use decoration: TextDecoration.none to remove underline
The problem is not 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 Theme
as a parent.
Why is that important to know? Because when you'll develop a Modal (using showDialog
for example), you'll face the same problem.
BUT Scaffold is an opaque fullscreen widget! And you obviously don't want that in your Modal.
There are many ways to introduce a Theme instance. In Material App, this is usually achieved by instantiating a Material
Widget.
And guess what? Scaffold
creates one for you. But Dialog
too!
2 ways is avalible:
use scaffuld in parent of screen
Scaffold(body: Container(child:Text("My Text")))
use material for parent of widget
Material(child: Text("My Text"))
You should add Material and Scaffold widgets in main.dart file
MaterialApp(
home: Scaffold(
body: Text('Hello world'),
),
);