Search code examples
flutterdartflutter-layoutflutter-design

How to change font size of textfield in Flutter?


I have a textfield and I want to change the font size of it because my application will be available for both iPad and mobile phones. The font size of the textfield is good for mobile phones but too small for iPad. How can I change it?


Solution

  • You can use the style property:

                       Text(
                          'Bronze Master',
                          style: TextStyle(
                            fontSize: 8,
                            color: Colors.blue.shade700,
                            fontWeight: FontWeight.w600,
                          ),
                        ),
    

    You should note that this font size is relative and the actual font size you see on your device will be based on the device's font size settings. This is also a really good way to figure out where you have overflow issue.

    1. Go to you device's settings
    2. Increase the font size to Large
    3. Open your Flutter app in debug mode and find the overflows