1. Column
- 垂直组件排版
- 组件内小控件间距可以通过SizedBox设置
- 整个组件内的间距可以通过padding设置
Widget build(BuildContext context) {
return Container( // 通过Container包裹起来
padding: const EdgeInsets.all(10), // 整个Column的四周间距
decoration: BoxDecoration( // 边框修饰
border: Border.all(),
color: Colors.blue, // 边框颜色
),
child: Column(
children: [
Text(
title,
style: TextStyle(fontSize: 20),
),
SizedBox( // 设置每个单元的小部件的间距
height: 5,
),
Text(
description,
style: TextStyle(fontSize: 15),
),
SizedBox(
height: 10,
),
Image.network(imageUrl),
],
),
);
}