Widget selectTime(double itemHeight, double itemWidth) {
return Expanded(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: GridView.builder(
primary: false,
// scrollDirection: Axis.vertical,
shrinkWrap: true,
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 10.0,
mainAxisSpacing: 20.0,
crossAxisCount: 3,
childAspectRatio: (itemHeight / itemWidth),
),
itemCount: timeslotsList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: new BoxDecoration(
color: const Color(0XFF9CA3F4),
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0),
bottomLeft: const Radius.circular(10.0),
bottomRight: const Radius.circular(10.0))),
);
},
),
));
}
我正在flutter应用程序中实现gridview。我现在成功创建了网格,我想在第二行之后给偶数行(Ex:2,4,6)之后给出间距,我想为gridview提供行间距