Only sort the routine list once

This commit is contained in:
Roland Geider
2023-02-11 10:11:53 +01:00
parent 711c99c11a
commit 64dc6867b7

View File

@@ -152,9 +152,9 @@ class WorkoutPlansProvider extends WgerBaseProvider with ChangeNotifier {
for (final workoutPlanData in data['results']) {
final plan = WorkoutPlan.fromJson(workoutPlanData);
_workoutPlans.add(plan);
_workoutPlans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
}
_workoutPlans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
notifyListeners();
}