Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change text color for Theme?

Tags:

flutter

This is my code, I don't understand, how to change text color for theme

void main() => runApp(new MaterialApp(
    title: 'Характеристика',
    home: new CharacteristList(),
  theme: new ThemeData(
    primaryColor: Colors.lightBlue,
    accentColor: Colors.lightBlueAccent,
  ),
)

enter image description here

like image 539
Вячеслав Avatar asked May 19 '18 12:05

Вячеслав


People also ask

How do you change the text color in a theme on flutter?

Steps to change theme text color in Flutter You can change theme text color in Flutter, by defining the TextTheme (inside MaterialApp) and then adding headings type. For example, headline1 , headline2 , BodyText1 , and so on. After that, you can assign the TextStyle widget with the color of your choice.

How do I change my text color?

Open your device's Settings app . Text and display. Select Color correction. Turn on Use color correction.


1 Answers

You can use textTheme:

theme: new ThemeData(
  primaryColor: Colors.blue,
  textTheme: Theme.of(context).textTheme.apply(
     bodyColor: Colors.blue,
     displayColor: Colors.blue,
  ))
like image 71
Phuc Tran Avatar answered Nov 15 '22 11:11

Phuc Tran