diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 3b628912..74fda6dd 100644 --- a/lib/pages/fav_detail/view.dart +++ b/lib/pages/fav_detail/view.dart @@ -339,20 +339,22 @@ class _FavDetailPageState extends State { loadingState.response[index].id, loadingState.response[index].type, ), - onTap: - _favDetailController.enableMultiSelect.value.not - ? null - : () { - _favDetailController.onSelect(index); - }, - onLongPress: () { - if (_favDetailController - .enableMultiSelect.value.not) { - _favDetailController.enableMultiSelect.value = - true; - _favDetailController.onSelect(index); - } - }, + onTap: _favDetailController.enableMultiSelect.value + ? () { + _favDetailController.onSelect(index); + } + : null, + onLongPress: _favDetailController.isOwner.value + ? () { + if (_favDetailController + .enableMultiSelect.value.not) { + _favDetailController + .enableMultiSelect.value = true; + _favDetailController.onSelect(index); + } + } + : null, + isOwner: _favDetailController.isOwner.value, ), ), Positioned( diff --git a/lib/pages/fav_detail/widget/fav_video_card.dart b/lib/pages/fav_detail/widget/fav_video_card.dart index d9364796..2e2b9435 100644 --- a/lib/pages/fav_detail/widget/fav_video_card.dart +++ b/lib/pages/fav_detail/widget/fav_video_card.dart @@ -20,6 +20,7 @@ class FavVideoCardH extends StatelessWidget { final int? searchType; final GestureTapCallback? onTap; final GestureLongPressCallback? onLongPress; + final bool isOwner; const FavVideoCardH({ super.key, @@ -28,6 +29,7 @@ class FavVideoCardH extends StatelessWidget { this.searchType, this.onTap, this.onLongPress, + this.isOwner = false, }); @override @@ -211,53 +213,51 @@ class FavVideoCardH extends StatelessWidget { ), ], ), - searchType != 1 - ? Positioned( - right: 0, - bottom: -4, - child: IconButton( - tooltip: '取消收藏', - style: ButtonStyle( - padding: WidgetStateProperty.all(EdgeInsets.zero), - ), - onPressed: () { - showDialog( - context: Get.context!, - builder: (context) { - return AlertDialog( - title: const Text('提示'), - content: const Text('要取消收藏吗?'), - actions: [ - TextButton( - onPressed: Get.back, - child: Text( - '取消', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .outline), - ), - ), - TextButton( - onPressed: () async { - await callFn?.call(); - Get.back(); - }, - child: const Text('确定取消'), - ) - ], - ); - }, + if (searchType != 1 && isOwner) + Positioned( + right: 0, + bottom: -4, + child: IconButton( + tooltip: '取消收藏', + style: ButtonStyle( + padding: WidgetStateProperty.all(EdgeInsets.zero), + ), + onPressed: () { + showDialog( + context: Get.context!, + builder: (context) { + return AlertDialog( + title: const Text('提示'), + content: const Text('要取消收藏吗?'), + actions: [ + TextButton( + onPressed: Get.back, + child: Text( + '取消', + style: TextStyle( + color: + Theme.of(context).colorScheme.outline), + ), + ), + TextButton( + onPressed: () async { + await callFn?.call(); + Get.back(); + }, + child: const Text('确定取消'), + ) + ], ); }, - icon: Icon( - Icons.clear_outlined, - color: Theme.of(context).colorScheme.outline, - size: 18, - ), - ), - ) - : const SizedBox(), + ); + }, + icon: Icon( + Icons.clear_outlined, + color: Theme.of(context).colorScheme.outline, + size: 18, + ), + ), + ), ], ), ),