Flutter – How to change Font Size of Text Widget?

In flutter app development, Text widget is the most usable widget even though we can say other widgets also use Text widgets for displaying information. In flutter by default font size is 14 pixels. We are going to share with you In this article How to change Font Size of Text Widget.


Default font size : 

In beginning, we saw flutter provide a default font size is 14 pixels. You can see the below example.


You can see the below screenshot with the default font size.



How to change the default font size in Text:

We can easily change the default font size in the text widget using style properties of the Text widget like the below example.

            style: TextStyle(fontSize: 20),

Full example :

class Errorgram extends StatefulWidget {
  const Errorgram({Key? key}) : super(key: key);

  State<Errorgram> createState() => _ErrorgramState();

class _ErrorgramState extends State<Errorgram> {
  void initState() {

  Widget build(BuildContext context) {
    return SafeArea(
        bottom: false,
        child: Scaffold(
          appBar: AppBar(
            title: Text("Errorgram"),
          body: Center(
              child: Text(
            style: TextStyle(fontSize: 20),



In this post, We saw How to change the font size of text widgets easily in a flutter. I hope this article will help you.