From dcd5b97c6ee750cc433e16cf2256bfe9c80e671b Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Sat, 21 Mar 2020 15:24:51 -0700 Subject: [PATCH] Fix checkup view during checkup submission --- lib/src/ui/screens/checkup/checkup.dart | 3 ++- lib/src/ui/screens/checkup/steps/intro.dart | 8 -------- lib/src/ui/screens/checkup/steps/subjective.dart | 8 -------- lib/src/ui/screens/checkup/steps/temperature.dart | 8 -------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/lib/src/ui/screens/checkup/checkup.dart b/lib/src/ui/screens/checkup/checkup.dart index 9cc6def..a294e1a 100644 --- a/lib/src/ui/screens/checkup/checkup.dart +++ b/lib/src/ui/screens/checkup/checkup.dart @@ -86,8 +86,9 @@ class _CheckupScreenState extends State { case CheckupStateCreating: return _getUnloadedBody(checkupState); case CheckupStateInProgress: - case CheckupStateCompleting: return CheckupLoadedBody(); + case CheckupStateCompleting: + return Container(); case CheckupStateCompleted: _handleCheckupCompletion(preferencesState, checkupState); return null; diff --git a/lib/src/ui/screens/checkup/steps/intro.dart b/lib/src/ui/screens/checkup/steps/intro.dart index 2419e08..4e46467 100644 --- a/lib/src/ui/screens/checkup/steps/intro.dart +++ b/lib/src/ui/screens/checkup/steps/intro.dart @@ -32,14 +32,6 @@ class _IntroStepState extends State { Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { - if (state is! CheckupStateInProgress) { - // We should never hit this, but if we do, let's - // navigate back to the beginning to make sure - // the checkup is created. - Navigator.pushNamed(context, CheckupScreen.routeName); - return Container(); - } - final CheckupStateInProgress checkupState = state; return SingleChildScrollView( child: Column( diff --git a/lib/src/ui/screens/checkup/steps/subjective.dart b/lib/src/ui/screens/checkup/steps/subjective.dart index 34e4a93..3e2a043 100644 --- a/lib/src/ui/screens/checkup/steps/subjective.dart +++ b/lib/src/ui/screens/checkup/steps/subjective.dart @@ -61,14 +61,6 @@ class _SubjectiveStepState extends State { final QuestionsStateLoaded questionState = state; return BlocBuilder( builder: (context, state) { - if (state is! CheckupStateInProgress) { - // We should never hit this, but if we do, let's - // navigate back to the beginning to make sure - // the checkup is created. - Navigator.pushNamed(context, CheckupScreen.routeName); - return Container(); - } - final CheckupStateInProgress checkupState = state; return QuestionView( padding: EdgeInsets.only(bottom: 80), diff --git a/lib/src/ui/screens/checkup/steps/temperature.dart b/lib/src/ui/screens/checkup/steps/temperature.dart index 8c49a59..e7354c3 100644 --- a/lib/src/ui/screens/checkup/steps/temperature.dart +++ b/lib/src/ui/screens/checkup/steps/temperature.dart @@ -126,14 +126,6 @@ class _TemperatureStepState extends State { Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { - if (state is! CheckupStateInProgress) { - // We should never hit this, but if we do, let's - // navigate back to the beginning to make sure - // the checkup is created. - Navigator.pushNamed(context, CheckupScreen.routeName); - return Container(); - } - final CheckupStateInProgress checkupState = state; final VitalsResponse existingResponse = checkupState.checkup.vitalsResponses.firstWhere(