前提
中央寄せとテキストと左寄せのテキストを作成しています。
実現したいこと
テキストを中央寄せにすることはできたのですが、左寄せのテキストが実装できません。
どなたかアドバイスいただけないでしょうか?
該当のソースコード
Dart
1import 'package:flutter/material.dart'; 2 3class TermsOfUse extends StatelessWidget { 4 5 Widget build(BuildContext context) { 6 final double deviceHeight = MediaQuery.of(context).size.height; //デバイスの高さ 7 final double devicewidth = MediaQuery.of(context).size.width; //デバイスの幅 8 return Scaffold( 9 backgroundColor: Colors.white, 10 appBar: AppBar( 11 iconTheme: IconThemeData(color: Colors.black), 12 leadingWidth: devicewidth * 0.2, 13 backgroundColor: Colors.white, 14 elevation: 0.0, 15 ), 16 body: Container( 17 child: Column( 18 children: <Widget>[ 19 Container( 20 width: double.infinity, 21 child: Text( 22 '利用規約', 23 textAlign: TextAlign.center, 24 style: TextStyle( 25 fontWeight: FontWeight.bold, 26 fontSize: 20.0, 27 ), 28 ), 29 ), 30 SizedBox( 31 height: deviceHeight * 0.02, 32 ), 33 Container( 34 width: double.infinity, 35 child: Text( 36 ' この利用規約(以下,「本規約」といいます。)は,_____(以下,「当社」といいます。)がこのウェブサイト上で提供するサービス(以下,「本サービス」といいます。)の利用条件を定めるものです。登録ユーザーの皆さま(以下,「ユーザー」といいます。)には,本規約に従って,本サービスをご利用いただきます。', 37 style: TextStyle(fontSize: 10.0), 38 ), 39 ), 40 SizedBox( 41 height: deviceHeight * 0.05, 42 ), 43 Text( 44 '第1条(適用)', 45 textAlign: TextAlign.left, 46 style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15.0), 47 ), 48 ], 49 ), 50 ), 51 ); 52 } 53} 54
試したこと
・TextウィジェットをContainaerで包む
・Flutter Clean
補足情報(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)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/11/23 09:16