diff --git a/lib/providers/nutritional_plans.dart b/lib/providers/nutritional_plans.dart index a612eaab..44d7b9f6 100644 --- a/lib/providers/nutritional_plans.dart +++ b/lib/providers/nutritional_plans.dart @@ -62,7 +62,7 @@ class NutritionalPlans with ChangeNotifier { ); print(plan.toJson()); print(json.decode(response.body)); - _entries.add(NutritionalPlan.fromJson(json.decode(response.body))); + _entries.insert(0, NutritionalPlan.fromJson(json.decode(response.body))); notifyListeners(); } catch (error) { print(error); diff --git a/lib/providers/workout_plans.dart b/lib/providers/workout_plans.dart index 6afd3f31..1572292a 100644 --- a/lib/providers/workout_plans.dart +++ b/lib/providers/workout_plans.dart @@ -150,13 +150,9 @@ class WorkoutPlans with ChangeNotifier { }, body: json.encode(workout.toJson()), ); - print(workout.toJson()); - print(json.decode(response.body)); - final newWorkout = WorkoutPlan.fromJson(json.decode(response.body)); - _entries.add(newWorkout); + _entries.insert(0, WorkoutPlan.fromJson(json.decode(response.body))); notifyListeners(); } catch (error) { - print(error); throw error; } }