Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size across entire MaterialApp?

Tags:

flutter

dart

I have a MaterialApp in Flutter and want to scale up text throughout the entire app when a certain fontFamily is used in ThemeData.

Is this because this certain fontFamily looks smaller than other fonts.

Is there a way to scale up the font size of the entire app using ThemeData?

like image 652
S.D. Avatar asked Nov 14 '18 04:11

S.D.


Video Answer


1 Answers

In ThemeData you have textTheme property in which you can set the TextTheme for all widgets under that MaterialApp. In TextTheme you can set TextStyle for various types of texts in you app using parameters like caption, subhead etc. You can increase the size of the font by providing value for fontSize property in TextStyle

Something like this:

MaterialApp(
  theme: ThemeData(
    textTheme: TextTheme(
      caption: TextStyle(
        fontSize: 22.0
      ),
      body1: TextStyle(
          fontSize: 22.0
      ),
    ),
  ),
);
like image 167
Thanthu Avatar answered Oct 26 '22 09:10

Thanthu