なにかお手伝いできることがあればご連絡ください。
お問い合わせはこちらから
※Googleフォームが表示されます
shrinkWrap: true
を追加することで利用可能になる。
body: Center(
child: Column(
children: [
Text('テキストテキスト'),
GridView.count(shrinkWrap: true, crossAxisCount: 2, children: [
Container(
color: Colors.grey,
child: const Text('ABCD'),
),
Container(
color: Colors.grey,
child: const Text('ABCD'),
),
])
],
),
),
GridViewのchildrenは普通に利用するアスペクト比1:1で表示されます。
そのため高さを変更したい場合、childAspectRatio
を追加する。
body: Center(
child: Column(
children: [
Text('テキストテキスト'),
GridView.count(
shrinkWrap: true,
crossAxisCount: 2,
crossAxisSpacing: 4.0,
childAspectRatio: 2 / 1,
children: [
Container(
color: Colors.grey,
child: const Text('ABCD'),
),
Container(
color: Colors.grey,
child: const Text('ABCD'),
),
])
],
),
),
通常画面遷移後に表示されるAppBarには戻るボタンが表示されますが、
automaticallyImplyLeading: false
を追加することで非表示にすることができます。
Scaffold(
appBar: AppBar(
title: const Text('テキスト'),
automaticallyImplyLeading: false,
),
Scaffold直下で利用できるWidget。
なにかお手伝いできることがあればご連絡ください。
※Googleフォームが表示されます