#mainAxisAlignmentがが効かない
](1a2d076806b86263594041f91add7b3e.jpeg)
上記画像の3つのテキストを縦に均等に配置したいです。
dart
1 return Scaffold( 2 appBar: AppBar( 3 title: Text('Home'), 4 ), 5 body: Container( 6 padding: EdgeInsets.all(20), 7 child: Column( 8 children: <Widget>[ 9 Card( 10 child: Row( 11 children: <Widget>[ 12 Image.network( 13 'https://image.tmdb.org/t/p/w154//5KYaB1CTAklQHm846mHTFkozgDN.jpg'), 14 Expanded( 15 child: Container( 16 padding: const EdgeInsets.all(10), 17 child: Column( 18 mainAxisAlignment: MainAxisAlignment.spaceEvenly, 19 children: <Widget>[ 20 Container( 21 width: double.infinity, 22 // height: 50, 23 child: Text( 24 'Godzilla vs. Kong', 25 style: Theme.of(context).textTheme.headline6, 26 textAlign: TextAlign.left, 27 ), 28 ), 29 Container( 30 width: double.infinity, 31 // height: 20, 32 child: Text( 33 '2021-03-24', 34 style: TextStyle( 35 color: Colors.grey.shade700, 36 ), 37 textAlign: TextAlign.left, 38 ), 39 ), 40 Container( 41 width: double.infinity, 42 // height: 60, 43 child: Text( 44 'In a time when monsters walk the Earth, humanity’s...', 45 textAlign: TextAlign.left, 46 ), 47 ), 48 ], 49 ), 50 ), 51 ) 52 ], 53 ), 54 ) 55 ], 56 ), 57 ), 58 );
こちらの参考のような形になっているのになぜ効かないのでしょうか??
dart
1Column( 2 mainAxisAlignment: MainAxisAlignment.spaceEvenly, 3 children: <Widget>[ 4 Text("item1"), 5 Text("item2"), 6 Text("item3"), 7 Text("item4"), 8 ], 9),
Column
のchildren
がText
ではなくContainer
だからでしょうか?
だとしたら、Container
の場合はどうすれば良いでしょうか??😨
Flutterのウィジェット難しすぎて禿げそうです。
添付いただいているスクリーンショットの赤枠はて入力での表示でしょうか?
FlutterInspector > Debug Paint すると描画領域が画面上に表示されると思いますが、
そちらで確認するといかがでしょうか。
またその表示を添付いただけると幸いです。
回答1件
あなたの回答
tips
プレビュー