Flutter ListViewの高さを定義する方法
- 2023年2月17日
- 技術情報
ListViewのアイテムの高さを定義するには、itemExtentを引数として使用します。
ListView(
itemExtent: //,
children : []
);
使用法例
return Scaffold(
body: ListView(
itemExtent: 150,
children: [
Card(
color: Colors.blue,
child: ListTile(
title: Text('Item1'),
),
),
Card(
color: Colors.blue,
child: ListTile(
title: Text('Item2'),
),
),
Card(
color: Colors.blue,
child: ListTile(
title: Text('Item3'),
),
),
],
),
);
![](https://www.gigas-jp.com/appnews/wp-content/uploads/sites/4/2023/02/Screen-Shot-2023-02-16-at-17.53.29.png)
金曜担当 – Ami
asahi at 2023年02月17日 10:00:00