mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
@@ -7,6 +7,7 @@ import 'package:PiliPlus/services/download/download_service.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:flutter/material.dart'
|
||||
hide SliverGridDelegateWithMaxCrossAxisExtent;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DownloadSearchPage extends StatefulWidget {
|
||||
@@ -47,6 +48,34 @@ class _DownloadSearchPageState
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
List<Widget>? get multiSelectActions => [
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(visualDensity: VisualDensity.compact),
|
||||
onPressed: () async {
|
||||
final allChecked = controller.allChecked.toSet();
|
||||
controller.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),
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget buildList(List<BiliDownloadEntryInfo> list) {
|
||||
if (list.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user