flutter - 如何在 Flutter 中的 ExpansionPanellist 中给出扩展面板之间的间距?
问题描述
我的应用程序包含多张带有复选框的卡片,无论工作是否完成。
我想创建包含多个扩展面板的扩展面板列表。但是当我想在每个ExpansionPanels之间给出16px的间距时,它没有展开但没有选择这样做。你能帮忙吗?
如果有任何其他替代方案来设计此布局,请提供帮助。
ExpansionPanelList(
// animationDuration: Duration(milliseconds: 10),
expandedHeaderPadding: EdgeInsets.only(top: 08),
elevation: 0,
children: [
ExpansionPanel(
isExpanded: _isOpen[0],
headerBuilder: (context, isOpen) {
return Padding(
padding: const EdgeInsets.symmetric(
vertical: 12, horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"0 Month",
style: ThemeText.s18w500Black,
),
Visibility(
visible: toggele0[0] && toggele0[1] && toggele0[2],
child: Row(
children: [
SvgPicture.asset(
"assets/icons/icon-vaccination-check.svg"),
SizedBox(
width: 6.5,
),
Text(
"Done",
style: ThemeText.s12w400Green2,
),
],
),
)
],
),
);
},
body: Column(
children: [
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele0[0]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele0[0],
onChanged: (value) {
setState(() {
toggele0[0] = !toggele0[0];
});
}),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele0[1]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele0[1],
onChanged: (value) {
setState(() {
toggele0[1] = !toggele0[1];
});
}),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele0[2]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele0[2],
onChanged: (value) {
setState(() {
toggele0[2] = !toggele0[2];
});
})
],
)),
ExpansionPanel(
isExpanded: _isOpen[1],
headerBuilder: (context, isOpen) {
return Padding(
padding: const EdgeInsets.symmetric(
vertical: 12, horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"1 Month",
style: ThemeText.s18w500Black,
),
Visibility(
visible: toggele1[0] && toggele1[1] && toggele1[2],
child: Row(
children: [
SvgPicture.asset(
"assets/icons/icon-vaccination-check.svg"),
SizedBox(
width: 6.5,
),
Text(
"Done",
style: ThemeText.s12w400Green2,
),
],
),
)
],
),
);
},
body: Column(
children: [
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele1[0]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele1[0],
onChanged: (value) {
setState(() {
toggele1[0] = !toggele1[0];
});
}),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele1[1]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele1[1],
onChanged: (value) {
setState(() {
toggele1[1] = !toggele1[1];
});
}),
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
activeColor: HexColor(HexColors.textColorGreen2),
title: Text(
"Oral Polio Vaccine (2nd dose)",
style: ThemeText.s16w400Black.copyWith(
decoration: toggele1[2]
? TextDecoration.lineThrough
: TextDecoration.none),
),
subtitle: Text("Protects against Poliomyelitis"),
value: toggele1[2],
onChanged: (value) {
setState(() {
toggele1[2] = !toggele1[2];
});
})
],
)),]),
解决方案
推荐阅读
- react-native - 如何在本机反应中获取Chield视图的大小?
- php - Google API PHP 库 files.get 并行
- android - 在模式的开头或结尾匹配一个单词
- amazon-web-services - 对 AWS lambda 函数执行限制感到困惑
- php - 如何为数组内的值创建常量并在php中的类外部访问它们
- c# - 使用 Microsoft Graph 获取电子邮件,无需任何用户交互
- javascript - 如何在标签更改时显示不同的 JointJS 块
- html - 下拉切换单击仅在中心工作
- json - 如何使用 Circe 库和 Scala 解析变体 Json?
- c# - 多次刷新 Aspx 页面时出现错误 503