mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-17 06:33:59 +08:00
@@ -81,11 +81,7 @@ class _FavSortPageState extends State<FavSortPage> with ReorderMixin {
|
||||
);
|
||||
}
|
||||
|
||||
void onReorder(int oldIndex, int newIndex) {
|
||||
if (newIndex > oldIndex) {
|
||||
newIndex -= 1;
|
||||
}
|
||||
|
||||
void onReorderItem(int oldIndex, int newIndex) {
|
||||
final oldItem = sortList[oldIndex];
|
||||
final newItem = sortList.getOrNull(
|
||||
oldIndex > newIndex ? newIndex - 1 : newIndex, // might be Negative
|
||||
@@ -94,15 +90,14 @@ class _FavSortPageState extends State<FavSortPage> with ReorderMixin {
|
||||
'${newItem == null ? '0:0' : '${newItem.id}:${newItem.type}'}:${oldItem.id}:${oldItem.type}',
|
||||
);
|
||||
|
||||
final tabsItem = sortList.removeAt(oldIndex);
|
||||
sortList.insert(newIndex, tabsItem);
|
||||
sortList.insert(newIndex, sortList.removeAt(oldIndex));
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
Widget get _buildBody {
|
||||
final child = ReorderableListView.builder(
|
||||
onReorder: onReorder,
|
||||
onReorderItem: onReorderItem,
|
||||
proxyDecorator: proxyDecorator,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding:
|
||||
@@ -113,7 +108,7 @@ class _FavSortPageState extends State<FavSortPage> with ReorderMixin {
|
||||
final item = sortList[index];
|
||||
return SizedBox(
|
||||
key: ValueKey(item.id),
|
||||
height: 98,
|
||||
height: 110,
|
||||
child: FavVideoCardH(item: item),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user