我在Flutter和ListView小部件上遇到了一个奇怪的问题。我可以看到项目之间的差距。我可以看到黑色背景。有什么我想念的东西,所以这些差距不会显示出来吗?这是整个应用程序代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
home: Container(
color: Colors.black,
child: new ListView.builder(
itemBuilder: (BuildContext context, int index) {
return new Container(
color: Colors.pink.shade100,
child: Container(
height: 100.0,
),
);
},
itemCount: 100,
),
),
);
}
}