update dm

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-28 11:23:29 +08:00
parent 2ca5310825
commit 21a2373a5c
7 changed files with 163 additions and 66 deletions

View File

@@ -94,6 +94,34 @@ class _DownloadDetailPageState extends State<DownloadDetailPage>
resizeToAvoidBottomInset: false,
appBar: MultiSelectAppBarWidget(
ctr: this,
actions: [
TextButton(
style: TextButton.styleFrom(
visualDensity: VisualDensity.compact,
),
onPressed: () async {
final allChecked = this.allChecked.toSet();
handleSelect();
final res = await Future.wait(
allChecked.map(
(e) => _downloadService.downloadDanmaku(
entry: e,
isUpdate: true,
),
),
);
if (res.every((e) => e)) {
SmartDialog.showToast('更新成功');
} else {
SmartDialog.showToast('更新失败');
}
},
child: Text(
'更新',
style: TextStyle(color: Get.theme.colorScheme.onSurface),
),
),
],
child: AppBar(
title: Text(widget.title),
actions: [

View File

@@ -57,7 +57,8 @@ class DetailItem extends StatelessWidget {
final outline = theme.colorScheme.outline;
final cid = entry.source?.cid ?? entry.pageData?.cid;
final canDel = onDelete != null;
void onLongPress() => canDel
final enableMultiSelect = controller.enableMultiSelect.value;
void onLongPress() => canDel && !enableMultiSelect
? showDialog(
context: context,
builder: (context) {
@@ -116,7 +117,7 @@ class DetailItem extends StatelessWidget {
Get.to(const DownloadingPage());
return;
}
if (controller.enableMultiSelect.value) {
if (enableMultiSelect) {
(onSelect ?? controller.onSelect).call(entry);
return;
}