Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-14 12:13:17 +08:00
parent 025775d231
commit 09be4f45f0
78 changed files with 428 additions and 849 deletions

View File

@@ -56,25 +56,20 @@ class _FavFolderSortPageState extends State<FavFolderSortPage>
);
}
void onReorder(int oldIndex, int newIndex) {
void onReorderItem(int oldIndex, int newIndex) {
if (oldIndex == 0 || newIndex == 0) {
SmartDialog.showToast('默认收藏夹不支持排序');
return;
}
if (newIndex > oldIndex) {
newIndex -= 1;
}
final tabsItem = sortList.removeAt(oldIndex);
sortList.insert(newIndex, tabsItem);
sortList.insert(newIndex, sortList.removeAt(oldIndex));
setState(() {});
}
Widget get _buildBody {
return ReorderableListView.builder(
onReorder: onReorder,
onReorderItem: onReorderItem,
proxyDecorator: proxyDecorator,
physics: const AlwaysScrollableScrollPhysics(),
itemCount: sortList.length,
@@ -83,12 +78,10 @@ class _FavFolderSortPageState extends State<FavFolderSortPage>
const EdgeInsets.only(bottom: 100),
itemBuilder: (context, index) {
final item = sortList[index];
final key = item.id.toString();
return SizedBox(
key: Key(key),
height: 98,
key: ValueKey(item.id),
height: 110,
child: FavVideoItem(
heroTag: key,
item: item,
onLongPress: index == 0
? () => SmartDialog.showToast('默认收藏夹不支持排序')