Redirect to the correct screen after editing a workout plan

This commit is contained in:
Roland Geider
2021-04-08 13:09:28 +02:00
parent ddad869fc9
commit ec2325b3e2

View File

@@ -82,10 +82,10 @@ class WorkoutForm extends StatelessWidget {
? await Provider.of<WorkoutPlans>(context, listen: false).editWorkout(_plan)
: await Provider.of<WorkoutPlans>(context, listen: false).addWorkout(_plan);
Navigator.of(context).pop();
if (_plan.id == null) {
Navigator.of(context).pushNamed(WorkoutPlanScreen.routeName, arguments: _plan);
}
Navigator.of(context).pushReplacementNamed(
WorkoutPlanScreen.routeName,
arguments: _plan,
);
},
),
],