mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-03 15:50:18 +08:00
opt: simple dialog
This commit is contained in:
@@ -56,47 +56,41 @@ class WhisperSessionItem extends StatelessWidget {
|
||||
: null,
|
||||
onLongPress: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: DefaultTextStyle(
|
||||
style: const TextStyle(fontSize: 14),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
builder: (context) => DefaultTextStyle(
|
||||
style: const TextStyle(fontSize: 14),
|
||||
child: SimpleDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
children: [
|
||||
SimpleDialogOption(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
onSetTop(item.isPinned, item.id);
|
||||
},
|
||||
child: Text(item.isPinned ? '移除置顶' : '置顶'),
|
||||
),
|
||||
if (item.id.privateId.hasTalkerUid())
|
||||
SimpleDialogOption(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
onSetTop(item.isPinned, item.id);
|
||||
onSetMute(item.isMuted, item.id.privateId.talkerUid);
|
||||
},
|
||||
title: Text(item.isPinned ? '移除置顶' : '置顶'),
|
||||
child: Text('${item.isMuted ? '关闭' : '开启'}免打扰'),
|
||||
),
|
||||
if (item.id.privateId.hasTalkerUid())
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetMute(item.isMuted, item.id.privateId.talkerUid);
|
||||
},
|
||||
title: Text('${item.isMuted ? '关闭' : '开启'}免打扰'),
|
||||
),
|
||||
if (item.id.privateId.hasTalkerUid())
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showConfirmDialog(
|
||||
context: context,
|
||||
title: const Text('确定删除该对话?'),
|
||||
onConfirm: () =>
|
||||
onRemove(item.id.privateId.talkerUid.toInt()),
|
||||
);
|
||||
},
|
||||
title: const Text('删除'),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (item.id.privateId.hasTalkerUid())
|
||||
SimpleDialogOption(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showConfirmDialog(
|
||||
context: context,
|
||||
title: const Text('确定删除该对话?'),
|
||||
onConfirm: () =>
|
||||
onRemove(item.id.privateId.talkerUid.toInt()),
|
||||
);
|
||||
},
|
||||
child: const Text('删除'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user