简体   繁体   English

在 listView flutter 中未定义子项和填充

[英]children and padding isnt defined in listView flutter

[children and padding isnt defined in listView flutter] [listView 颤动中未定义子项和填充]

return ListView( padding: const EdgeInsets.all(8),返回ListView(填充:const EdgeInsets.all(8),

children: [ Container( height: 50, color: Colors.amber[600], child: const Center(child: Text('Entry A')), ), Container( height: 50, color: Colors.amber[500], child: const Center(child: Text('Entry B')), ), Container( height: 50, color: Colors.amber[100], child: const Center(child: Text('Entry C')), ), ], );孩子:[容器(高度:50,颜色:Colors.amber[600],孩子:常量中心(孩子:文本('Entry A')),),容器(高度:50,颜色:Colors.amber[500] , child: const Center(child: Text('Entry B')), ), Container( height: 50, color: Colors.amber[100], child: const Center(child: Text('Entry C')), ), ], );

the problem was my class name was ListView when i changed name it work properly.问题是我的 class 名称是 ListView,当我更改名称时它可以正常工作。

we must choose names that diffrent from dart flutter classes我们必须选择与 dart flutter 类不同的名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM