「Flutter/UI/Text」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→色追加) |
|||
| 行30: | 行30: | ||
), | ), | ||
) | ) | ||
| + | </pre> | ||
| + | |||
| + | ==右側にアイコン追加== | ||
| + | <pre> | ||
| + | ListTile( | ||
| + | leading: ExcludeSemantics(child: CircleAvatar(child: Text(item))), | ||
| + | title: Text('This item represents $item.'), | ||
| + | subtitle: secondary, | ||
| + | trailing: Icon(Icons.info, color: Theme.of(context).disabledColor), | ||
| + | ), | ||
</pre> | </pre> | ||
2019年11月19日 (火) 01:09時点における版
body内に複数行textを表示
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'hello',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
RaisedButton(
child: Text('Back to MyPage 1'),
onPressed: () {
Navigator.pop(context);
},
),
],
),
),
色追加
Text(
'警告!',
style: TextStyle(
color: Colors.red,
),
)
右側にアイコン追加
ListTile(
leading: ExcludeSemantics(child: CircleAvatar(child: Text(item))),
title: Text('This item represents $item.'),
subtitle: secondary,
trailing: Icon(Icons.info, color: Theme.of(context).disabledColor),
),
