mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: FavVideoCardH
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -76,14 +76,17 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
final item = (_favController.loadingState.value as Success)
|
final item = (_favController.loadingState.value as Success)
|
||||||
.response
|
.response
|
||||||
.first;
|
.first;
|
||||||
Get.toNamed('/favSearch', arguments: {
|
Get.toNamed(
|
||||||
'type': 1,
|
'/favSearch',
|
||||||
'mediaId': item.id,
|
arguments: {
|
||||||
'title': item.title,
|
'type': 1,
|
||||||
'count': item.mediaCount,
|
'mediaId': item.id,
|
||||||
'searchType': SearchType.fav,
|
'title': item.title,
|
||||||
'isOwner': true,
|
'count': item.mediaCount,
|
||||||
});
|
'searchType': SearchType.fav,
|
||||||
|
'isOwner': true,
|
||||||
|
},
|
||||||
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ class _FavSortPageState extends State<FavSortPage> {
|
|||||||
FavVideoCardH(
|
FavVideoCardH(
|
||||||
isSort: true,
|
isSort: true,
|
||||||
videoItem: item,
|
videoItem: item,
|
||||||
isOwner: false,
|
|
||||||
),
|
),
|
||||||
if (BuildConfig.isDebug)
|
if (BuildConfig.isDebug)
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@@ -475,11 +475,13 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: FavVideoCardH(
|
child: FavVideoCardH(
|
||||||
videoItem: item,
|
videoItem: item,
|
||||||
callFn: () => _favDetailController.onCancelFav(
|
onDelFav: _favDetailController.isOwner.value
|
||||||
index,
|
? () => _favDetailController.onCancelFav(
|
||||||
item.id!,
|
index,
|
||||||
item.type!,
|
item.id!,
|
||||||
),
|
item.type!,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
onViewFav: () {
|
onViewFav: () {
|
||||||
Utils.toViewPage(
|
Utils.toViewPage(
|
||||||
'bvid=${item.bvid}&cid=${item.cid}',
|
'bvid=${item.bvid}&cid=${item.cid}',
|
||||||
@@ -514,7 +516,6 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
isOwner: _favDetailController.isOwner.value,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@@ -17,22 +17,18 @@ import '../../../common/widgets/badge.dart';
|
|||||||
// 收藏视频卡片 - 水平布局
|
// 收藏视频卡片 - 水平布局
|
||||||
class FavVideoCardH extends StatelessWidget {
|
class FavVideoCardH extends StatelessWidget {
|
||||||
final FavDetailItemData videoItem;
|
final FavDetailItemData videoItem;
|
||||||
final Function? callFn;
|
|
||||||
final int? searchType;
|
|
||||||
final GestureTapCallback? onTap;
|
final GestureTapCallback? onTap;
|
||||||
final GestureLongPressCallback? onLongPress;
|
final GestureLongPressCallback? onLongPress;
|
||||||
final bool isOwner;
|
final VoidCallback? onDelFav;
|
||||||
final VoidCallback? onViewFav;
|
final VoidCallback? onViewFav;
|
||||||
final bool? isSort;
|
final bool? isSort;
|
||||||
|
|
||||||
const FavVideoCardH({
|
const FavVideoCardH({
|
||||||
super.key,
|
super.key,
|
||||||
required this.videoItem,
|
required this.videoItem,
|
||||||
this.callFn,
|
this.onDelFav,
|
||||||
this.searchType,
|
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
this.isOwner = false,
|
|
||||||
this.onViewFav,
|
this.onViewFav,
|
||||||
this.isSort,
|
this.isSort,
|
||||||
});
|
});
|
||||||
@@ -210,7 +206,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (searchType != 1 && isOwner)
|
if (onDelFav != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
@@ -237,9 +233,9 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
await callFn?.call();
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
onDelFav!();
|
||||||
},
|
},
|
||||||
child: const Text('确定取消'),
|
child: const Text('确定取消'),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -96,9 +96,7 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
|||||||
return _favSearchCtr.searchType == SearchType.fav
|
return _favSearchCtr.searchType == SearchType.fav
|
||||||
? FavVideoCardH(
|
? FavVideoCardH(
|
||||||
videoItem: item,
|
videoItem: item,
|
||||||
isOwner: _favSearchCtr.isOwner ?? false,
|
onDelFav: _favSearchCtr.isOwner == true
|
||||||
searchType: _favSearchCtr.type,
|
|
||||||
callFn: _favSearchCtr.type != 1
|
|
||||||
? () {
|
? () {
|
||||||
_favSearchCtr.onCancelFav(
|
_favSearchCtr.onCancelFav(
|
||||||
index,
|
index,
|
||||||
|
|||||||
Reference in New Issue
Block a user