「Flutter/font」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→日本語フォント対応) |
|||
| 行24: | 行24: | ||
locale: Locale("ja", "JP"), | locale: Locale("ja", "JP"), | ||
</pre> | </pre> | ||
| + | |||
| + | ==フォントスタイル== | ||
| + | style: TextStyle( | ||
| + | fontWeight: FontWeight.bold, | ||
| + | fontFamily: 'Cursive', | ||
| + | ), | ||
2019年11月29日 (金) 14:24時点における版
日本語フォント対応
androidはデフォルトで中華フォントになってる。 iosは日本語が当たってた。
Textの対応
Textの第2引数
Text('編集')
↓
Text('編集', style: TextStyle(locale: Locale("ja", "JP"))
children: <Widget>[
CupertinoButton.filled(
child: const Text('編集', style: TextStyle(locale: Locale("ja", "JP"))
アプリtitle対応
locale: Locale("ja", "JP"),を追加
app.dart
Widget build(BuildContext context) {
return MaterialApp(
locale: Locale("ja", "JP"),
フォントスタイル
style: TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Cursive',
),
