mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08: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:
@@ -6,7 +6,6 @@ import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/fav_order_type.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_detail/data.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||
@@ -305,64 +304,48 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
];
|
||||
}
|
||||
|
||||
List<Widget> _selectActions(ThemeData theme) => [
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
visualDensity: VisualDensity.compact,
|
||||
List<Widget> _selectActions(ThemeData theme) {
|
||||
final btnStyle = TextButton.styleFrom(visualDensity: .compact);
|
||||
final textStyle = TextStyle(color: theme.colorScheme.onSurfaceVariant);
|
||||
return [
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: () => _favDetailController.handleSelect(checked: true),
|
||||
child: const Text('全选'),
|
||||
),
|
||||
onPressed: () => _favDetailController.handleSelect(checked: true),
|
||||
child: const Text('全选'),
|
||||
),
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
visualDensity: VisualDensity.compact,
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: () => RequestUtils.onCopyOrMove<FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: true,
|
||||
ctr: _favDetailController,
|
||||
mediaId: _favDetailController.mediaId,
|
||||
mid: _favDetailController.account.mid,
|
||||
),
|
||||
child: Text('复制', style: textStyle),
|
||||
),
|
||||
onPressed: () =>
|
||||
RequestUtils.onCopyOrMove<FavDetailData, FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: true,
|
||||
ctr: _favDetailController,
|
||||
mediaId: _favDetailController.mediaId,
|
||||
mid: _favDetailController.account.mid,
|
||||
),
|
||||
child: Text(
|
||||
'复制',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: () => RequestUtils.onCopyOrMove<FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: false,
|
||||
ctr: _favDetailController,
|
||||
mediaId: _favDetailController.mediaId,
|
||||
mid: _favDetailController.account.mid,
|
||||
),
|
||||
child: Text('移动', style: textStyle),
|
||||
),
|
||||
TextButton(
|
||||
style: btnStyle,
|
||||
onPressed: _favDetailController.onRemove,
|
||||
child: Text(
|
||||
'删除',
|
||||
style: TextStyle(color: theme.colorScheme.error),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
onPressed: () =>
|
||||
RequestUtils.onCopyOrMove<FavDetailData, FavDetailItemModel>(
|
||||
context: context,
|
||||
isCopy: false,
|
||||
ctr: _favDetailController,
|
||||
mediaId: _favDetailController.mediaId,
|
||||
mid: _favDetailController.account.mid,
|
||||
),
|
||||
child: Text(
|
||||
'移动',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
onPressed: _favDetailController.onRemove,
|
||||
child: Text(
|
||||
'删除',
|
||||
style: TextStyle(color: theme.colorScheme.error),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
];
|
||||
const SizedBox(width: 10),
|
||||
];
|
||||
}
|
||||
|
||||
Widget _flexibleSpace(ThemeData theme) {
|
||||
final style = TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user