6

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?

batuhankrbb
  • 598
  • 7
  • 10

3 Answers3

6

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
Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61
4

Use style under TextField

TextField(
 style:TextStyle(fontSize:10),

 //want to change the style for label and hint then
 
 decoration:InputDecoration(
   labelStyle:TextStyle(fontSize:10),
   hintStyle: TextStyle(fontSize:10),
 )
)
Avnish Nishad
  • 1,634
  • 1
  • 17
  • 18
1

I found it. The font size of the TextField can be changed through its style property

batuhankrbb
  • 598
  • 7
  • 10