Slackコミュニティに
無料で参加する
Flutterラボの
プレミアム会員になる
【Flutter】RichTextでテキストの途中で色やサイズを変更する
2021.12.09
文字を表示するのはTextウィジェットですが、RichTextを使うことでテキストの途中でスタイルを変えることができます。

RichText(
text: TextSpan(
style: Theme.of(context).textTheme.bodyText2,
children: const [
TextSpan(
text: 'Flutter',
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold, color: Colors.blue)
),
TextSpan(
text: 'ラボ',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.blue)
),
TextSpan(
text: 'は あらゆる角度から',
style: TextStyle(fontSize: 18)
),
TextSpan(
text: 'Flutter',
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold, color: Colors.blue)
),
TextSpan(
text: 'が学べるサービスです',
style: TextStyle(fontSize: 18)
),
]
),
)
FlutterラボのWEBサイトでも多用しています。
Flutterラボ
hatchoutschool
Flutter Daily
Flutterに関する記事を日々更新しています (223本)

【Dart】Stringからint, double, DateTimeに変換する
2020.09.14

【Dart】【Flutter】List型(リスト)の使い方とよく使うメソッドまとめ
2020.09.18

【Dart】【Flutter】DateTime型についてのまとめ
2020.10.01

【Dart】Map型の使い方とよく使うメソッドまとめ
2020.09.13