forked from coronavirus-diary/coronavirus-diary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add positive and negative assessment screens
- Loading branch information
Showing
15 changed files
with
248 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_hud/flutter_hud.dart'; | ||
|
||
import 'package:coronavirus_diary/src/blocs/checkup/checkup.dart'; | ||
import 'assessments/index.dart'; | ||
import 'share.dart'; | ||
|
||
class AssessmentScreen extends StatelessWidget { | ||
static const routeName = '/assessment'; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<CheckupBloc, CheckupState>( | ||
builder: (context, state) { | ||
Widget body; | ||
if (state is CheckupStateInProgress) { | ||
context.bloc<CheckupBloc>().add(CompleteCheckup()); | ||
} else if (state is CheckupStateCompleted) { | ||
switch (state.assessment.matchesPuiSymptoms) { | ||
case true: | ||
body = PositiveAssessment(); | ||
break; | ||
case false: | ||
body = NegativeAssessment(); | ||
break; | ||
} | ||
} | ||
return WidgetHUD( | ||
showHUD: state is CheckupStateCompleting, | ||
hud: HUD(label: 'Loading your assessment'), | ||
builder: (context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text('Your Personalized Assessment'), | ||
), | ||
body: body, | ||
); | ||
}, | ||
); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'positive.dart'; | ||
export 'negative.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
|
||
import 'package:coronavirus_diary/src/ui/screens/assessment/share.dart'; | ||
|
||
class NegativeAssessment extends StatefulWidget { | ||
@override | ||
_NegativeAssessmentState createState() => _NegativeAssessmentState(); | ||
} | ||
|
||
class _NegativeAssessmentState extends State<NegativeAssessment> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Container( | ||
margin: EdgeInsets.only(bottom: 10), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: FaIcon( | ||
FontAwesomeIcons.solidSmile, | ||
color: Colors.white, | ||
size: 70, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 20), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"You don't meet testing criteria", | ||
style: Theme.of(context).textTheme.title, | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 20), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"If you continue to experience symptoms, please check in tomorrow. ", | ||
style: Theme.of(context).textTheme.body2.copyWith(fontSize: 16), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 40), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"If they become serious, please consult a physician.", | ||
style: Theme.of(context).textTheme.body2.copyWith(fontSize: 16), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
ShareApp(), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:coronavirus_diary/src/ui/screens/assessment/share.dart'; | ||
|
||
class PositiveAssessment extends StatefulWidget { | ||
@override | ||
_PositiveAssessmentState createState() => _PositiveAssessmentState(); | ||
} | ||
|
||
class _PositiveAssessmentState extends State<PositiveAssessment> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Container( | ||
margin: EdgeInsets.only(bottom: 5), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
'🤔', | ||
style: TextStyle(fontSize: 70), | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 20), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"Please contact your physician", | ||
style: Theme.of(context).textTheme.title, | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 20), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"You are showing symptoms that may be of concern. " | ||
"Please limit your contact with other people until you have a chance to follow up with a physician", | ||
style: Theme.of(context).textTheme.body2.copyWith(fontSize: 16), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 40), | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
child: Text( | ||
"Do not panic. This is only a preliminary assessment and not a formal medical diagnosis.", | ||
style: Theme.of(context).textTheme.body2.copyWith(fontSize: 16), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
ShareApp(), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:font_awesome_flutter/fa_icon.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import 'package:share/share.dart'; | ||
|
||
class ShareApp extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
void _shareApp() { | ||
Share.share( | ||
'Worried that you might have COVID-19? ' | ||
'Download this app to checkup on your health and support your community: APP_LINK', | ||
); | ||
} | ||
|
||
return Container( | ||
color: Colors.white.withOpacity(0.2), | ||
padding: EdgeInsets.symmetric( | ||
horizontal: 40, | ||
vertical: 20, | ||
), | ||
child: Column( | ||
children: <Widget>[ | ||
Container( | ||
margin: EdgeInsets.only(bottom: 10), | ||
child: FaIcon( | ||
FontAwesomeIcons.heartbeat, | ||
color: Colors.red, | ||
size: 40, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 10), | ||
child: Text( | ||
"Protect Your Community", | ||
style: Theme.of(context).textTheme.title, | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 20), | ||
child: Text( | ||
"Share this app with your friends, coworkers, and family (especially grandparents).", | ||
style: Theme.of(context).textTheme.body1.copyWith( | ||
fontSize: 16, | ||
fontWeight: FontWeight.bold, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
RaisedButton( | ||
onPressed: _shareApp, | ||
child: Text('Share now'), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters