@@ -17,7 +17,7 @@ abstract class SortingNotifier extends StateNotifier<SortingNotifierState> {
1717
1818 static double maxListItemHeight = 250. h;
1919 static double itemsPadding = 1. w;
20- static const ThemeEnum swipedColor = ThemeEnum .redColor;
20+ static const ThemeEnum swipingColor = ThemeEnum .redColor;
2121 static const ThemeEnum comparedColor = ThemeEnum .comparedColor;
2222 static const ThemeEnum itemColor = ThemeEnum .blueColor;
2323 static const ThemeEnum doneSortingColor = ThemeEnum .greenColor;
@@ -145,9 +145,9 @@ abstract class SortingNotifier extends StateNotifier<SortingNotifierState> {
145145
146146 break ;
147147
148- case SortingStatus .swapped :
149- list[step.index1] = list[step.index1].copyWith (sortedStatus: SortingStatus .swapped );
150- list[step.index2] = list[step.index2].copyWith (sortedStatus: SortingStatus .swapped );
148+ case SortingStatus .swiping :
149+ list[step.index1] = list[step.index1].copyWith (sortedStatus: SortingStatus .swiping );
150+ list[step.index2] = list[step.index2].copyWith (sortedStatus: SortingStatus .swiping );
151151 state = state.copyWith (list: list);
152152
153153 await Future .delayed (speedDuration);
@@ -162,13 +162,14 @@ abstract class SortingNotifier extends StateNotifier<SortingNotifierState> {
162162 state = state.copyWith (list: list, positions: positions);
163163 break ;
164164
165+ case SortingStatus .swiped:
165166 case SortingStatus .unSorted:
166167 list[step.index1] = list[step.index1].copyWith (sortedStatus: SortingStatus .unSorted);
167168 list[step.index2] = list[step.index2].copyWith (sortedStatus: SortingStatus .unSorted);
168169 state = state.copyWith (list: list);
169170 break ;
170171
171- // i don't want to make it green while sorting and mark all of them at once as green at the end
172+ // i don't want to make it green while sorting and mark all of them at once as green at the end
172173 case SortingStatus .sorted:
173174 case SortingStatus .none:
174175 list[step.index1] = list[step.index1].copyWith (sortedStatus: SortingStatus .none);
@@ -181,5 +182,6 @@ abstract class SortingNotifier extends StateNotifier<SortingNotifierState> {
181182
182183 await greenSortedItemsAsDone ();
183184 }
185+
184186 List <SortingStep > buildSorting (List <int > values);
185187}
0 commit comments