どうも、ちょげ(@chogetarou)です。
ListView.builderでパディングを設定する方法を紹介します。
方法

ListView.builderでパディングを設定するには、引数「padding」を使います。
具体的には、引数「padding」に「EdgedInsets.all(/*パディング*/)」を指定します。
ListView.builder(
padding: EdgeInsets.all(/*パディング*/),
itemCount: /*count*/,
itemBuilder: (context, index) {
return /*Item*/;
},
),
以下は、使用例になります。
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: ListView.builder(
padding: EdgeInsets.all(50),
itemCount: 20,
itemBuilder: (context, index) {
return Card(
color: Colors.blue,
);
},
itemExtent: 50,
),
),
);
}

コメント