change font size in flutter
Text(
'Some text',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold),
)
3
1
child: Text(
'Hello World! This is a text widget.',
style: TextStyle(fontSize: 25),
)
Thank you!
1
0
5
5
/// Android has different 'textscalefactor' settings, like:
/// 'Small: 0.85', 'Default: 1.0', 'Large: 1.15', 'Largest: 1.3'
/// To make sure the text in your app stays as you intended it to,
/// use the MediaQuery Widget to overwrite the system default:
@override
Widget build(BuildContext context) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.15), // Large
child: Scaffold(),
),
};
Thank you!
5
0
3.5
2
new MaterialButton(
height: 140.0,
minWidth: double.infinity,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
child: new Text(
"material button",
style: new TextStyle(
fontSize: 20.0,
color: Colors.yellow,
),
),
onPressed: () => {},
splashColor: Colors.redAccent,
);
Thank you!
2
0
Are there any code examples left?
New code examples in category Other