mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-30 06:10:10 +08:00
opt: simple dialog
This commit is contained in:
@@ -91,34 +91,31 @@ class _BubblePageState extends State<BubblePage>
|
||||
tooltip: '排序',
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder: (context) => SimpleDialog(
|
||||
clipBehavior: .hardEdge,
|
||||
contentPadding: const .symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: .min,
|
||||
children: sortInfo.sortItems!.map(
|
||||
(e) {
|
||||
final isSelected = item.sortType == e.sortType;
|
||||
return ListTile(
|
||||
dense: true,
|
||||
enabled: !isSelected,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
if (!isSelected) {
|
||||
_controller.onSort(e.sortType);
|
||||
}
|
||||
},
|
||||
title: Text(
|
||||
e.text!,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
trailing: isSelected
|
||||
? const Icon(size: 22, Icons.check)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
),
|
||||
children: sortInfo.sortItems!.map(
|
||||
(e) {
|
||||
final isSelected = item.sortType == e.sortType;
|
||||
return ListTile(
|
||||
dense: true,
|
||||
enabled: !isSelected,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
if (!isSelected) {
|
||||
_controller.onSort(e.sortType);
|
||||
}
|
||||
},
|
||||
title: Text(
|
||||
e.text!,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
trailing: isSelected
|
||||
? const Icon(size: 22, Icons.check)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
),
|
||||
),
|
||||
icon: const Icon(Icons.sort, size: 20),
|
||||
|
||||
Reference in New Issue
Block a user