【发布时间】:2021-12-31 22:02:05
【问题描述】:
我正在学习 Flutter,但有些东西我在任何地方都找不到。
比如我想把choicechip数据传给listtile
https://drive.google.com/file/d/1QmeeZeAAhvMT77_FvQ8XQ5hg8KdGk-d-/view?usp=sharing
但我不知道如何在 listtile 中传递数据。
我怎样才能使它成为可能?
Wrap(
runSpacing: spacing,
spacing: spacing,
children: goodType
// ignore: non_constant_identifier_names
.map((GoodTypes) => ChoiceChip(
label: Text(GoodTypes.label),
labelStyle:
GoogleFonts.ubuntu(color: Colors.white),
onSelected: (isSelected) => setState(() {
goodType = goodType.map((otherChip) {
final newChip =
otherChip.copy(isSelected: false);
// print(goodType);
return GoodTypes == newChip
? newChip.copy(
isSelected: isSelected)
: newChip;
}).toList();
print(GoodTypes.label);
}),
selected: GoodTypes.goodSelected,
selectedColor: AppColor.yellow,
backgroundColor: AppColor.blackrussain,
shape: StadiumBorder(
side: BorderSide(color: AppColor.yellow),
),
))
.toList(),
),
【问题讨论】:
标签: android flutter flutter-layout