mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 16:48:16 +08:00
@@ -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: [
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user