mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: media list page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,21 +12,21 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
|||||||
|
|
||||||
class MediaListPanel extends StatefulWidget {
|
class MediaListPanel extends StatefulWidget {
|
||||||
const MediaListPanel({
|
const MediaListPanel({
|
||||||
|
super.key,
|
||||||
required this.mediaList,
|
required this.mediaList,
|
||||||
this.changeMediaList,
|
this.changeMediaList,
|
||||||
this.panelTitle,
|
this.panelTitle,
|
||||||
this.bvid,
|
this.bvid,
|
||||||
this.hasMore = false,
|
|
||||||
required this.loadMoreMedia,
|
required this.loadMoreMedia,
|
||||||
super.key,
|
required this.count,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<MediaVideoItemModel> mediaList;
|
final List<MediaVideoItemModel> mediaList;
|
||||||
final Function? changeMediaList;
|
final Function? changeMediaList;
|
||||||
final String? panelTitle;
|
final String? panelTitle;
|
||||||
final String? bvid;
|
final String? bvid;
|
||||||
final bool hasMore;
|
|
||||||
final VoidCallback loadMoreMedia;
|
final VoidCallback loadMoreMedia;
|
||||||
|
final int count;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MediaListPanel> createState() => _MediaListPanelState();
|
State<MediaListPanel> createState() => _MediaListPanelState();
|
||||||
@@ -78,7 +78,7 @@ class _MediaListPanelState extends State<MediaListPanel> {
|
|||||||
itemBuilder: ((context, index) {
|
itemBuilder: ((context, index) {
|
||||||
var item = widget.mediaList[index];
|
var item = widget.mediaList[index];
|
||||||
if (index == widget.mediaList.length - 1 &&
|
if (index == widget.mediaList.length - 1 &&
|
||||||
widget.hasMore) {
|
widget.mediaList.length < widget.count) {
|
||||||
widget.loadMoreMedia();
|
widget.loadMoreMedia();
|
||||||
}
|
}
|
||||||
return InkWell(
|
return InkWell(
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ class VideoDetailController extends GetxController
|
|||||||
changeMediaList: changeMediaList,
|
changeMediaList: changeMediaList,
|
||||||
panelTitle: watchLaterTitle.value,
|
panelTitle: watchLaterTitle.value,
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
hasMore: mediaList.length < Get.arguments['count'],
|
count: Get.arguments['count'],
|
||||||
loadMoreMedia: loadMoreMedia,
|
loadMoreMedia: loadMoreMedia,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user