fix onReorder deprication

This commit is contained in:
ericz committed 2026-06-13 13:22:15 +02:00
1 parent 577e1772d3
commit 5c612b9a46
3 files changed
+3 -9

No files matched your search

+1 -4
View File
@@ -281,10 +281,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
), ),
buildDefaultDragHandles: false, buildDefaultDragHandles: false,
itemCount: filteredChannels.length, itemCount: filteredChannels.length,
onReorder: (oldIndex, newIndex) { onReorderItem: (oldIndex, newIndex) {
if (oldIndex < newIndex) {
newIndex -= 1;
}
final reordered = List<Channel>.from( final reordered = List<Channel>.from(
filteredChannels, filteredChannels,
); );
+1 -1
View File
@@ -447,7 +447,7 @@ class MeshTheme {
pageTransitionsTheme: const PageTransitionsTheme( pageTransitionsTheme: const PageTransitionsTheme(
builders: { builders: {
TargetPlatform.android: FadeForwardsPageTransitionsBuilder(), TargetPlatform.android: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), TargetPlatform.iOS: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.linux: FadeForwardsPageTransitionsBuilder(), TargetPlatform.linux: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.macOS: FadeForwardsPageTransitionsBuilder(), TargetPlatform.macOS: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.windows: FadeForwardsPageTransitionsBuilder(), TargetPlatform.windows: FadeForwardsPageTransitionsBuilder(),
+1 -4
View File
@@ -142,9 +142,6 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
void _reorderHop(int oldIndex, int newIndex) { void _reorderHop(int oldIndex, int newIndex) {
setState(() { setState(() {
if (oldIndex < newIndex) {
newIndex -= 1;
}
final hop = _hops.removeAt(oldIndex); final hop = _hops.removeAt(oldIndex);
_hops.insert(newIndex, hop); _hops.insert(newIndex, hop);
_syncHexFromHops(); _syncHexFromHops();
@@ -287,7 +284,7 @@ class _PathEditorSheetState extends State<PathEditorSheet> {
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
buildDefaultDragHandles: false, buildDefaultDragHandles: false,
itemCount: _hops.length, itemCount: _hops.length,
onReorder: _reorderHop, onReorderItem: _reorderHop,
itemBuilder: _hopTile, itemBuilder: _hopTile,
), ),
const Divider(), const Divider(),