Android 如何在这些列表平铺之间放置分隔符
我对编码还不熟悉,我刚刚开始了我的第一个项目,我正在阅读颤振的文档,并试图自己做一些事情,但这一个有点难,我如何在这些列表块之间放置分隔符 我尝试了一些类似ListView.separated和类似的替代方案,但无法在我的代码上运行,可能是因为它的结构不知何故都是错误的,有什么提示吗Android 如何在这些列表平铺之间放置分隔符,android,flutter,flutter-layout,Android,Flutter,Flutter Layout,我对编码还不熟悉,我刚刚开始了我的第一个项目,我正在阅读颤振的文档,并试图自己做一些事情,但这一个有点难,我如何在这些列表块之间放置分隔符 我尝试了一些类似ListView.separated和类似的替代方案,但无法在我的代码上运行,可能是因为它的结构不知何故都是错误的,有什么提示吗 Widget build(BuildContext context) { return Container( child: Drawer( child: ListView( children
Widget build(BuildContext context) {
return Container(
child: Drawer(
child: ListView(
children: <Widget>[
UserAccountsDrawerHeader(
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.blueGrey,
child: Text(
"LPI",
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w700,
),
),
),
accountName: Text(
'Lucas Pereira Issler',
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w700,
),
),
accountEmail: Text(
'lucas.issler@ftc.edu.br',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
),
ListTile(
leading: Icon(
Icons.pets,
size: 40,
color: Colors.blueAccent,
),
title: Text('Adoção',
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w800,
color: Colors.blueAccent,
)),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
leading: Icon(
Icons.remove_red_eye,
size: 40,
color: Colors.blueAccent,
),
title: Text('Desaparecidos',
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w800,
color: Colors.blueAccent,
)),
onTap: () {
Navigator.pop(context);
},
),
小部件构建(构建上下文){
返回容器(
孩子:抽屉(
子:ListView(
儿童:[
UserAccountsDrawerHeader(
currentAccountPicture:CircleAvatar(
背景颜色:颜色。蓝灰色,
子:文本(
“LPI”,
样式:TextStyle(
字体大小:32,
fontWeight:fontWeight.w700,
),
),
),
帐户名称:文本(
“卢卡斯·佩雷拉·伊斯勒”,
样式:TextStyle(
尺寸:22,
fontWeight:fontWeight.w700,
),
),
帐户电子邮件:文本(
”“卢卡斯。issler@ftc.edu.br',
样式:TextStyle(
尺寸:14,
fontWeight:fontWeight.w400,
),
),
),
列表砖(
领先:图标(
图标,宠物,
尺码:40,
颜色:Colors.blueAccent,
),
标题:文本(“Adoção”,
样式:TextStyle(
尺寸:22,
fontWeight:fontWeight.w800,
颜色:Colors.blueAccent,
)),
onTap:(){
Navigator.pop(上下文);
},
),
列表砖(
领先:图标(
图标。移除红色的眼睛,
尺码:40,
颜色:Colors.blueAccent,
),
标题:文本(“Desaparecidos”,
样式:TextStyle(
尺寸:22,
fontWeight:fontWeight.w800,
颜色:Colors.blueAccent,
)),
onTap:(){
Navigator.pop(上下文);
},
),
您需要为ListTile创建一个单独的ListView.separated()。请签出它,希望它能有所帮助
你试过了吗