質問内容
テキストを表示したくて、
textAlign: TextAlign.center,
を指定しているのですが、中央寄せすることができません。
どうすれば中央寄せすることができるのでしょうか?
該当のソースコード
Dart
1import 'package:flutter/material.dart'; 2 3class TermsOfUse extends StatelessWidget { 4 5 Widget build(BuildContext context) { 6 return Scaffold( 7 backgroundColor: Colors.white, 8 appBar: AppBar( 9 iconTheme: IconThemeData(color: Colors.black), 10 leadingWidth: devicewidth * 0.2, 11 backgroundColor: Colors.white, 12 elevation: 0.0, 13 ), 14 body: Container( 15 child: Text( 16 'テキスト', 17 textAlign: TextAlign.center, 18 style: TextStyle( 19 fontWeight: FontWeight.bold, 20 fontSize: 20.0, 21 ), 22 ), 23 ), 24 ); 25 } 26}
試したこと
・flutter clean
・VScodeの再起動
補足情報(FW/ツールのバージョンなど)
[✓] Flutter (Channel stable, 3.3.8, on macOS 13.0.1 22A400 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.73.0)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。