Change Font Size of the Whole App in Flutter

To change the font size of your app in Flutter, you can use the ThemeData class. This class provides methods for configuring the overall theme of an application.

To change the font size, you can use the textTheme property. This property expects a TextTheme instance, which defines various text styles.

MaterialApp(
  theme: ThemeData(
    textTheme: TextTheme(
      caption: TextStyle(
        fontSize: 14.0
      ),
      bodyText1: TextStyle(
          fontSize: 16.0
      ),
    ),
  ),
);
MaterialApp(
    title: 'App Title',
    debugShowCheckedModeBanner: false,
    theme: ThemeData(
        primarySwatch: MyTheme.mainColor, 
        textTheme: Theme.of(context).textTheme.apply(
              bodyColor: MyTheme.textColor,
              displayColor: MyTheme.textColor,
              fontFamily: GoogleFonts.aBeeZee().fontFamily,
              fontSizeFactor: 1.25,
            ),
        visualDensity: VisualDensity.adaptivePlatformDensity,
        backgroundColor: MyTheme.appBarColor),
    home: const LoginPage(),
)

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close