mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 12:04:50 +08:00
@@ -37,7 +37,7 @@ class DownloadDetailPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DownloadDetailPageState extends State<DownloadDetailPage>
|
||||
with BaseMultiSelectMixin<BiliDownloadEntryInfo> {
|
||||
with BaseMultiSelectMixin<BiliDownloadEntryInfo>, GridMixin {
|
||||
StreamSubscription? _sub;
|
||||
final _downloadItems = RxList<BiliDownloadEntryInfo>();
|
||||
final _controller = Get.find<DownloadPageController>();
|
||||
@@ -149,11 +149,7 @@ class _DownloadDetailPageState extends State<DownloadDetailPage>
|
||||
sliver: Obx(() {
|
||||
if (_downloadItems.isNotEmpty) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 2,
|
||||
mainAxisExtent: 100,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
),
|
||||
gridDelegate: gridDelegate,
|
||||
itemBuilder: (context, index) {
|
||||
final entry = _downloadItems[index];
|
||||
return DetailItem(
|
||||
|
||||
@@ -23,7 +23,7 @@ class DownloadingPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DownloadingPageState extends State<DownloadingPage>
|
||||
with BaseMultiSelectMixin<BiliDownloadEntryInfo> {
|
||||
with BaseMultiSelectMixin<BiliDownloadEntryInfo>, GridMixin {
|
||||
final _downloadService = Get.find<DownloadService>();
|
||||
late final _waitDownloadQueue = _downloadService.waitDownloadQueue;
|
||||
@override
|
||||
@@ -69,11 +69,7 @@ class _DownloadingPageState extends State<DownloadingPage>
|
||||
sliver: Obx(() {
|
||||
if (_waitDownloadQueue.isNotEmpty) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 2,
|
||||
mainAxisExtent: 100,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
),
|
||||
gridDelegate: gridDelegate,
|
||||
itemCount: _waitDownloadQueue.length,
|
||||
itemBuilder: (context, index) {
|
||||
final entry = _waitDownloadQueue[index];
|
||||
|
||||
@@ -29,7 +29,8 @@ class _DownloadSearchPageState
|
||||
DownloadSearchPage,
|
||||
List<BiliDownloadEntryInfo>,
|
||||
BiliDownloadEntryInfo
|
||||
> {
|
||||
>
|
||||
with GridMixin {
|
||||
@override
|
||||
DownloadSearchController controller = Get.put(DownloadSearchController());
|
||||
final _downloadService = Get.find<DownloadService>();
|
||||
@@ -84,11 +85,7 @@ class _DownloadSearchPageState
|
||||
Widget buildList(List<BiliDownloadEntryInfo> list) {
|
||||
if (list.isNotEmpty) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 2,
|
||||
mainAxisExtent: 100,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
),
|
||||
gridDelegate: gridDelegate,
|
||||
itemBuilder: (context, index) {
|
||||
final entry = list[index];
|
||||
return DetailItem(
|
||||
|
||||
@@ -34,7 +34,7 @@ class DownloadPage extends StatefulWidget {
|
||||
State<DownloadPage> createState() => _DownloadPageState();
|
||||
}
|
||||
|
||||
class _DownloadPageState extends State<DownloadPage> {
|
||||
class _DownloadPageState extends State<DownloadPage> with GridMixin {
|
||||
final _downloadService = Get.find<DownloadService>();
|
||||
final _controller = Get.put(DownloadPageController());
|
||||
final _progress = ChangeNotifier();
|
||||
@@ -139,7 +139,7 @@ class _DownloadPageState extends State<DownloadPage> {
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
height: 110,
|
||||
child: DetailItem(
|
||||
entry: entry,
|
||||
progress: _progress,
|
||||
@@ -172,12 +172,7 @@ class _DownloadPageState extends State<DownloadPage> {
|
||||
),
|
||||
),
|
||||
SliverGrid.builder(
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 2,
|
||||
mainAxisExtent: 100,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
),
|
||||
gridDelegate: gridDelegate,
|
||||
itemBuilder: (context, index) {
|
||||
final item = _controller.pages[index];
|
||||
if (item.entries.length == 1) {
|
||||
|
||||
Reference in New Issue
Block a user