opt reorder

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-28 23:27:37 +08:00
parent 88c01ffca3
commit 11b6f241b0
5 changed files with 37 additions and 22 deletions

View File

@@ -1,3 +1,4 @@
import 'package:PiliPlus/common/widgets/reorder_mixin.dart';
import 'package:PiliPlus/http/fav.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
@@ -16,10 +17,10 @@ class FavFolderSortPage extends StatefulWidget {
State<FavFolderSortPage> createState() => _FavFolderSortPageState();
}
class _FavFolderSortPageState extends State<FavFolderSortPage> {
class _FavFolderSortPageState extends State<FavFolderSortPage>
with ReorderMixin {
FavController get _favController => widget.favController;
final GlobalKey _key = GlobalKey();
late List<FavFolderInfo> sortList = List<FavFolderInfo>.from(
_favController.loadingState.value.data!,
);
@@ -73,8 +74,8 @@ class _FavFolderSortPageState extends State<FavFolderSortPage> {
Widget get _buildBody {
return ReorderableListView.builder(
key: _key,
onReorder: onReorder,
proxyDecorator: proxyDecorator,
physics: const AlwaysScrollableScrollPhysics(),
itemCount: sortList.length,
padding: