feat: copy/move fav

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-27 14:43:17 +08:00
parent 896510f852
commit 49b631d560
8 changed files with 224 additions and 29 deletions

View File

@@ -17,6 +17,8 @@ class FavDetailController extends MultiSelectController {
RxBool isOwner = false.obs;
RxBool titleCtr = false.obs;
dynamic mid;
@override
void onInit() {
// item = Get.arguments;
@@ -26,6 +28,8 @@ class FavDetailController extends MultiSelectController {
}
super.onInit();
mid = GStorage.userInfo.get('userInfoCache')?.mid;
queryData();
}
@@ -33,8 +37,7 @@ class FavDetailController extends MultiSelectController {
bool customHandleResponse(Success response) {
if (currentPage == 1) {
item.value = response.response.info;
isOwner.value = response.response.info.mid ==
GStorage.userInfo.get('userInfoCache')?.mid;
isOwner.value = response.response.info.mid == mid;
}
if (response.response.medias.isEmpty) {
isEnd = true;

View File

@@ -111,11 +111,57 @@ class _FavDetailPageState extends State<FavDetailPage> {
actions: _favDetailController.enableMultiSelect.value
? [
TextButton(
style: TextButton.styleFrom(
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
),
onPressed: () =>
_favDetailController.handleSelect(true),
child: const Text('全选'),
),
TextButton(
style: TextButton.styleFrom(
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
),
onPressed: () => Utils.onCopyOrMove(
context: context,
isCopy: true,
ctr: _favDetailController,
),
child: Text(
'复制到',
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
),
),
TextButton(
style: TextButton.styleFrom(
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
),
onPressed: () => Utils.onCopyOrMove(
context: context,
isCopy: false,
ctr: _favDetailController,
),
child: Text(
'移动到',
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
),
),
TextButton(
style: TextButton.styleFrom(
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
),
onPressed: () =>
_favDetailController.onDelChecked(context),
child: Text(