physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
return GridView.builder(
// physics: NeverScrollableScrollPhysics(),
//shrinkWrap: true,
padding: const EdgeInsets.all(0.0),
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
//单个widget的水平最大宽度
maxCrossAxisExtent: 110,
//垂直单个子widget间距
mainAxisSpacing: 4,
//水平单个子widget间距
crossAxisSpacing: 4,
),
itemBuilder: (context, index) {
return Image.file(_imageFileList[index], fit: BoxFit.fill);
},
itemCount: _imageFileList.length,
);
return GridView.builder(
padding: const EdgeInsets.all(0.0),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 3,
//垂直单个子widget间距
mainAxisSpacing: 4,
//水平单个子widget间距
crossAxisSpacing: 4,
//item宽高比例
childAspectRatio: 1.0),
itemBuilder: (context, index) {
return Image.file(_imageFileList[index], fit: BoxFit.fill);
},
itemCount: _imageFileList.length,
);
Wrap(
spacing: 8.0, // gap between adjacent chips
runSpacing: 4.0, // gap between lines
children: [
Chip(
avatar: CircleAvatar(
backgroundColor: Colors.blue.shade900, child: new Text('AH', style: TextStyle(fontSize: 10.0),)),
label: Text('Hamilton'),
),
Chip(
avatar: CircleAvatar(
backgroundColor: Colors.blue.shade900, child: new Text('ML', style: TextStyle(fontSize: 10.0),)),
label: Text('Lafayette'),
),
Chip(
avatar: CircleAvatar(
backgroundColor: Colors.blue.shade900, child: new Text('HM', style: TextStyle(fontSize: 10.0),)),
label: Text('Mulligan'),
),
Chip(
avatar: CircleAvatar(
backgroundColor: Colors.blue.shade900, child: new Text('JL', style: TextStyle(fontSize: 10.0),)),
label: Text('Laurens'),
),
],
)