mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-25 04:45:54 +08:00
@@ -1,5 +1,6 @@
|
||||
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/pages/common/common_search_controller.dart';
|
||||
@@ -14,6 +15,8 @@ class FavSearchController
|
||||
dynamic count = Get.arguments['count'];
|
||||
dynamic title = Get.arguments['title'];
|
||||
|
||||
final Rx<FavOrderType> order = FavOrderType.mtime.obs;
|
||||
|
||||
@override
|
||||
Future<LoadingState<FavDetailData>> customGetData() =>
|
||||
FavHttp.userFavFolderDetail(
|
||||
@@ -22,6 +25,7 @@ class FavSearchController
|
||||
mediaId: mediaId,
|
||||
keyword: editController.text,
|
||||
type: type,
|
||||
order: order.value,
|
||||
);
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
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/pages/common/common_search_page.dart';
|
||||
@@ -24,6 +25,29 @@ class _FavSearchPageState extends CommonSearchPageState<FavSearchPage,
|
||||
tag: Utils.generateRandomString(8),
|
||||
);
|
||||
|
||||
@override
|
||||
List<Widget>? get extraActions => [
|
||||
Obx(
|
||||
() {
|
||||
return PopupMenuButton<FavOrderType>(
|
||||
icon: const Icon(Icons.sort),
|
||||
requestFocus: false,
|
||||
initialValue: controller.order.value,
|
||||
tooltip: '排序方式',
|
||||
onSelected: (value) => controller
|
||||
..order.value = value
|
||||
..onReload(),
|
||||
itemBuilder: (context) => FavOrderType.values
|
||||
.map((e) => PopupMenuItem(
|
||||
value: e,
|
||||
child: Text(e.label),
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget buildList(List<FavDetailItemModel> list) {
|
||||
return SliverGrid(
|
||||
|
||||
Reference in New Issue
Block a user