こんにちは、フラメルです。
今回はText
のフォントサイズを変更する方法を紹介します。
目次
フォントサイズの変更方法


Text
のフォントサイズはstyle
>TextStyle
>fontSize
で変更できます。
Text(
'Hello World',
style: TextStyle(fontSize: 35),
),
サンプルコード
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Flutter'),
),
body: Center(
child: Text(
'Hello World',
style: TextStyle(fontSize: 35),
),
),
),
);
}
}
以上です。