flutter中添加分割线
时间: 2024-06-15 10:02:57 浏览: 262
以下是在Flutter中添加分割线的两种方法:
1. 使用Divider组件[^1]:
```dart
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Container(
height: 65.0,
),
Divider(
height: 1.0,
indent: 60.0,
color: Colors.red,
),
Container(
height: 65.0,
),
],
);
}
```
2. 使用DecoratedBox组件:
```dart
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Container(
height: 65.0,
),
DecoratedBox(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.red,
width: 1.0,
),
),
),
),
Container(
height: 65.0,
),
],
);
}
```
阅读全文
相关推荐
















