feat: pm: remove/setTop

This commit is contained in:
bggRGjQaUbCoE
2024-09-29 17:04:39 +08:00
parent f1e64752ae
commit 3a59b8bb60
5 changed files with 182 additions and 41 deletions

View File

@@ -172,6 +172,57 @@ class _WhisperPageState extends State<WhisperPage> {
content.toString();
}
return ListTile(
tileColor: sessionList[i].topTs == 0
? null
: Theme.of(context)
.colorScheme
.primaryContainer,
onLongPress: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
clipBehavior: Clip.hardEdge,
contentPadding:
const EdgeInsets.symmetric(
vertical: 12),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
dense: true,
onTap: () {
Get.back();
_whisperController
.onSetTop(i);
},
title: Text(
sessionList[i].topTs == 0
? '置顶'
: '移除置顶',
style: const TextStyle(
fontSize: 14),
),
),
ListTile(
dense: true,
onTap: () {
Get.back();
_whisperController
.onRemove(i);
},
title: const Text(
'删除',
style:
TextStyle(fontSize: 14),
),
),
],
),
);
},
);
},
onTap: () {
setState(() {
sessionList[i].unreadCount = 0;