我想以“Booking APP”過濾器中表示的方式列出文本按鈕

我嘗試了 Row、ListView 和 GridView,我想要多行中的一行。
編碼
SingleChildScrollView(
padding: FxSpacing.x(24),
scrollDirection: Axis.horizontal,
child: Row(
children:
['Any', '1', '2', '3', '4', '5'].map((element) {
return InkWell(
onTap: () {
setState(() {
if (estateHomeController.selectedBathRooms.contains(element)) {
estateHomeController.selectedBathRooms.remove(element);
} else {
estateHomeController.selectedBathRooms.add(element);
}
});
},
child: SingleBath(
bath: element,
selected: estateHomeController.selectedBathRooms.contains(element),
));
}).toList()),
),
uj5u.com熱心網友回復:
嘗試Wrap小部件
Wrap(
children: ['Any', '1', '2', '3', '4', '5']
.map(
(e) => InkWell(
onTap: () {
setState(() {
if (estateHomeController.selectedBathRooms.contains(element)) {
estateHomeController.selectedBathRooms.remove(element);
} else {
estateHomeController.selectedBathRooms.add(element);
}
});
},
child: SingleBath(
bath: element,
selected: estateHomeController.selectedBathRooms.contains(element),
)),
)
.toList(),
spacing: 8,
runSpacing: 8,
),
uj5u.com熱心網友回復:
材料芯片也可能適合您的用例,因為您正在考慮使用這些芯片作為過濾器來顯示不同的結果
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/482576.html
