我是新来扑我想要做这样的设计,带我一会儿找到什么样的使用,但没有时间我试着代码和使用列表视图,它给我错误,或者卡不符合。
0
你可以使用内和返回卡你的风格定义,在内建设者,我将建立自己的需要设计。
这里是内的正式文件。 [文件1
我是新来扑我想要做这样的设计,带我一会儿找到什么样的使用,但没有时间我试着代码和使用列表视图,它给我错误,或者卡不符合。
你可以使用内和返回卡你的风格定义,在内建设者,我将建立自己的需要设计。
这里是内的正式文件。 [文件1
尝试下码希望对您有所帮助。请参阅 GridView
在这里,
Center(
child: GridView.builder(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(horizontal: 30),
itemCount: 4,
itemBuilder: (ctx, i) {
return Card(
child: Container(
height: 290,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)),
margin: EdgeInsets.all(5),
padding: EdgeInsets.all(5),
child: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: Image.network(
'https://tech.pelmorex.com/wp-content/uploads/2020/10/flutter.png',
fit: BoxFit.fill,
),
),
Text(
'Title',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Row(
children: [
Text(
'Subtitle',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
)
],
),
],
),
),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 1.0,
crossAxisSpacing: 0.0,
mainAxisSpacing: 5,
mainAxisExtent: 264,
),
),
),