mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-27 19:48:37 +00:00
feat: add copy/move support to fav/later search results (#1822)
* feat: add copy/move support to fav/later search results * update Signed-off-by: dom <githubaccount56556@proton.me> --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -4,7 +4,9 @@ import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
||||
import 'package:PiliPlus/pages/common/search/common_search_page.dart';
|
||||
import 'package:PiliPlus/pages/fav_detail/widget/fav_video_card.dart';
|
||||
import 'package:PiliPlus/pages/fav_search/controller.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -29,6 +31,38 @@ class _FavSearchPageState
|
||||
tag: Utils.generateRandomString(8),
|
||||
);
|
||||
|
||||
@override
|
||||
List<Widget>? get multiSelectActions {
|
||||
final btnStyle = TextButton.styleFrom(visualDensity: .compact);
|
||||
final textStyle = TextStyle(
|
||||
color: ColorScheme.of(context).onSurfaceVariant,
|
||||
);
|
||||
return [
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: () => RequestUtils.onCopyOrMove<FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: true,
|
||||
ctr: controller,
|
||||
mediaId: controller.mediaId,
|
||||
mid: Accounts.main.mid,
|
||||
),
|
||||
child: Text('复制', style: textStyle),
|
||||
),
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: () => RequestUtils.onCopyOrMove<FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: false,
|
||||
ctr: controller,
|
||||
mediaId: controller.mediaId,
|
||||
mid: Accounts.main.mid,
|
||||
),
|
||||
child: Text('移动', style: textStyle),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<Widget>? get extraActions => [
|
||||
Obx(
|
||||
|
||||
Reference in New Issue
Block a user