I am new to flutter and trying out things.
I replaced the Scaffold Widget with a Center Widget (Just messing around). All text had a Yellow underline, to overcome this I used TextDecoration
Text(
friend.name,
style: TextStyle(
decoration: TextDecoration.none
),
));
But this was required for all Text widget hence I tried to set it universally for all Text widgets by setting Theme data in the root MaterialApp.
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Friends List',
theme: ThemeData(
primaryColor: Colors.black,
primarySwatch: Colors.teal,
primaryTextTheme: TextTheme(
headline1: TextStyle(color: Colors.green, decoration: TextDecoration.none),
headline2: TextStyle(color: Colors.green, decoration: TextDecoration.none),
headline3: TextStyle(color: Colors.green, decoration: TextDecoration.none),
headline4: TextStyle(color: Colors.green, decoration: TextDecoration.none),
headline5: TextStyle(color: Colors.green, decoration: TextDecoration.none),
headline6: TextStyle(color: Colors.green, decoration: TextDecoration.none),
bodyText1: TextStyle(color: Colors.green, decoration: TextDecoration.none),
bodyText2: TextStyle(color: Colors.green, decoration: TextDecoration.none),
),
textTheme: TextTheme(
headline1: TextStyle(decoration: TextDecoration.none),
headline2: TextStyle(decoration: TextDecoration.none),
headline3: TextStyle(decoration: TextDecoration.none),
headline4: TextStyle(decoration: TextDecoration.none),
headline5: TextStyle(decoration: TextDecoration.none),
headline6: TextStyle(decoration: TextDecoration.none),
bodyText1: TextStyle(decoration: TextDecoration.none),
bodyText2: TextStyle(decoration: TextDecoration.none)
),
),
home: MyHomePage(title: 'Friends list'),
);
}
}
But the Text widget still as the underline. What I'm trying is similar to setting a style to a tag in css not having to set it every time.
p
{
universal style here
}
Am I doing anything wrong? Is there a similar support in flutter. Please correct me if I'm wring