What is Flutter Text’s Default Font Size?

Flutter has a Text widget that you can use to display text on your screens. By default, the font size is 14 pixels. However, you can change the font size to any value you want. In this post, we will show you how to change the font size in Flutter Text.

Ways to Change Text Font Size

MaterialApp(
  theme: ThemeData(
    textTheme: TextTheme(
      bodyText1: TextStyle(fontSize: 16.0),
      bodyText2: TextStyle(fontSize: 20.0),
      button: TextStyle(fontSize: 16.0),
    ),
  ),

);
Text(
        'Error! Please try again later!',
        style: TextStyle(fontSize: 18),
      )
Text("Default Text Style",
         style:
            TextStyle(
               color: Colors.black,
               fontSize: Theme.of(context).textTheme.body1.fontSize
            )
      )

Similar Posts

  • Dialog Packages

    A Dialog is a class that is intended to be subclassed by other classes. It’s often used to display messages on the page, or make choices available to the user. Flutter has a few built-in dialogs, but there are times when you need to build your own or use an existing package. adaptive_dialog Adaptively display…

  • PDF Packages

    pdf This is a Dart PDF file creator. It can generate pdf files for both the web and Flutter. This library is made up of two parts: a low-level Pdf generation library that manages the creation of the PDF documents. A widgets system comparable to Flutter’s, for easier high-level Pdf production. TrueType fonts can be…

  • Bottom Bar Packages

    convex_bottom_bar The ConvexAppBar is a Flutter package that creates and shows a convex tab in the bottom bar. Theming is supported. persistent_bottom_nav_bar For Flutter, a complete, highly configurable bottom navigation bar that is persistent/static and can be used for any application. It has up to 20 different styles. salomon_bottom_bar Another bottom navigation bar, but this…

  • Flutter Projects for Beginners

    If you’re just getting started with Flutter, you might be feeling a little overwhelmed. There are so many different things to learn, and it can be hard to know where to start. That’s why we’ve put together this list of 8 Flutter projects for beginners. These projects will help you get comfortable with the basics…

  • Date and Calendar Packages

    date_format The date_format is an easy-to use API that provides several constants for building your own Date format string. Use the `formatDate` method to create customised dates, and be sure they look good on any device! It provides various constants that you can use when building your Date string with the formatDate method, so it’s…