fix: medialist: del btn

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-16 18:44:32 +08:00
parent b99cf4f629
commit bddeb72d9b
4 changed files with 7 additions and 4 deletions

View File

@@ -158,6 +158,7 @@ class FavDetailController extends MultiSelectController {
'favTitle': item.value.title, 'favTitle': item.value.title,
'count': item.value.mediaCount, 'count': item.value.mediaCount,
'desc': true, 'desc': true,
'isOwner': isOwner.value,
}, },
); );
break; break;

View File

@@ -23,7 +23,7 @@ class FavVideoCardH extends StatelessWidget {
final GestureTapCallback? onTap; final GestureTapCallback? onTap;
final GestureLongPressCallback? onLongPress; final GestureLongPressCallback? onLongPress;
final bool isOwner; final bool isOwner;
final VoidCallback? onViewFav; final VoidCallback onViewFav;
const FavVideoCardH({ const FavVideoCardH({
super.key, super.key,
@@ -33,7 +33,7 @@ class FavVideoCardH extends StatelessWidget {
this.onTap, this.onTap,
this.onLongPress, this.onLongPress,
this.isOwner = false, this.isOwner = false,
this.onViewFav, required this.onViewFav,
}); });
@override @override
@@ -67,7 +67,7 @@ class FavVideoCardH extends StatelessWidget {
Get.toNamed('/member?mid=${videoItem.owner?.mid}'); Get.toNamed('/member?mid=${videoItem.owner?.mid}');
return; return;
} }
onViewFav!(); onViewFav();
// Utils.toViewPage( // Utils.toViewPage(
// 'bvid=$bvid&cid=${videoItem.cid}${epId?.isNotEmpty == true ? '&epId=$epId' : ''}', // 'bvid=$bvid&cid=${videoItem.cid}${epId?.isNotEmpty == true ? '&epId=$epId' : ''}',
// arguments: { // arguments: {

View File

@@ -415,7 +415,8 @@ class VideoDetailController extends GetxController
getMediaList(isLoadPrevious: true); getMediaList(isLoadPrevious: true);
} }
: null, : null,
onDelete: ['watchLater', 'fav'].contains(sourceType) onDelete: sourceType == 'watchLater' ||
(sourceType == 'fav' && Get.arguments?['isOwner'] == true)
? (index) async { ? (index) async {
if (sourceType == 'watchLater') { if (sourceType == 'watchLater') {
var res = await UserHttp.toViewDel( var res = await UserHttp.toViewDel(

View File

@@ -121,6 +121,7 @@ class _MediaListPanelState extends CommonSlidePageState<MediaListPanel> {
widget.onDelete != null && widget.mediaList.length > 1; widget.onDelete != null && widget.mediaList.length > 1;
return ScrollablePositionedList.builder( return ScrollablePositionedList.builder(
itemScrollController: _scrollController, itemScrollController: _scrollController,
physics: const AlwaysScrollableScrollPhysics(),
itemCount: widget.mediaList.length, itemCount: widget.mediaList.length,
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80, bottom: MediaQuery.paddingOf(context).bottom + 80,