Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP added UI screens for dev-161 [DONT MERGE YET] #72

Merged
merged 3 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,21 @@
"Cough": "Cough",
"shortness.breath": "Shortness of breath",
"when.seek.medical": "When to seek medical attention",
"if.you.develop": "If you develop emergency warning signs for COVID-19 get medical attention immediately. Emergency warning signs include*:"
"if.you.develop": "If you develop emergency warning signs for COVID-19 get medical attention immediately. Emergency warning signs include*:",
"have.you.been.tested": "Have you been tested for COVID-19?",
"yes.tested.for": "Yes, I have been tested for COVID-19",
"not.tested.for": "No, I have not been tested for COVID-19",
"next": "Next",
"are.feeling.sick": "Are you feeling sick?",
"yes.feel.sick": "Yes, I feel sick",
"not.feel.sick": "No, I don’t feel sick",
"yes.feel.sick.message": "I feel sick and have not tested for COVID-19",
"confirm.your.answer": "Confirm your answer & submit your check-in status",
"go.back": "Go Back",
"prev.ques": "Previous Question",
"by.responding": "By Responding, I accept the ",
"thank.you.for.part": "Thank you for doing your part in the fight against COVID-19.",
"we.will.now.cross": "We will now cross-reference your location information with existing location information and notify you if you could be at risk.",
"done": "Done",
"is.sick.not.tested.message": "Please make sure you monitor your symptoms and update your status if you stop experiencing symptoms or test for COVID-19."
}
62 changes: 62 additions & 0 deletions lib/ui_v1_1/common/ui/CTCommonRadioGroup.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CTCommonRadioGroup extends StatefulWidget {
final List<String> list;
final Function(int selected) selectedCallback;

CTCommonRadioGroup(this.list, this.selectedCallback);

@override
State<StatefulWidget> createState() {
return CTCommonRadioGroupState();
}
}

class CTCommonRadioGroupState extends State<CTCommonRadioGroup> {
String _selectedItem;

@override
void initState() {
assert(widget.list != null && widget.list.isNotEmpty);
super.initState();
}

@override
Widget build(BuildContext context) {
return Column(
children: widget.list.map((e) => getRadioListTileContainer(e)).toList(),
);
}

Widget getRadioListTileContainer(String item) {
return Container(
height: 80,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 20),
decoration: BoxDecoration(
color: Color(0xffF3F4FC),
border: Border.all(
color: _selectedItem != null && _selectedItem == item
? Color(0xff475DF3)
: Colors.white,
width: 1.0),
borderRadius: BorderRadius.all(Radius.circular(10.0))),
child: RadioListTile(
activeColor: Color(0xff475DF3),
controlAffinity: ListTileControlAffinity.trailing,
title: Text(
item,
style: TextStyle(fontSize: 17, color: Color(0xff1A1D4A)),
),
value: item,
groupValue: _selectedItem,
onChanged: (newValue) {
setState(() {
_selectedItem = newValue;
widget.selectedCallback.call(widget.list.indexOf(_selectedItem));
});
}),
);
}
}
255 changes: 255 additions & 0 deletions lib/ui_v1_1/home_checkin/WatchForSymptomsWidget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
import 'package:corona_trace/utils/app_localization.dart';
import 'package:flutter/material.dart';

import 'home_confirm_not_sick.dart';

class WatchForSymptomsWidget {
final bool showBottomButtons;
final Function(Widget response) onNextScreen;
final bool needsScroll;

WatchForSymptomsWidget(
{this.showBottomButtons, this.onNextScreen, this.needsScroll});

Widget get(context) {
if (needsScroll) {
return SingleChildScrollView(
child: getInnerContent(context),
);
}
return getInnerContent(context);
}

Container getInnerContent(context) {
return Container(
child: Column(
children: <Widget>[
SizedBox(height: 32),
getWatchForSymptomsColumn(),
getWhenToSeekMedical(),
SizedBox(height: 20),
getHowToProtect(),
showBottomButtons ? bottomContent(context) : Container()
],
),
);
}

getWatchForSymptomsColumn() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ListTile(
title: Text(
AppLocalization.text("watch.for.symptoms"),
style: TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
),
subtitle: Padding(
child: Text(
AppLocalization.text("this.guidance.was"),
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
color: Color(0xff1A1D4A)),
),
padding: EdgeInsets.only(top: 16),
),
),
ListTile(
title: Text(AppLocalization.text("these.symptoms.may.appear"),
style: TextStyle(fontSize: 17, color: Color(0xff1A1D4A))),
),
SizedBox(height: 10),
ListTile(
title: Text(
"• " + AppLocalization.text("Fever"),
style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
),
Divider(
height: 0.5,
indent: 20,
color: Color(0xffBAC8E1),
),
ListTile(
title: Text(
"• " + AppLocalization.text("Cough"),
style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
),
Divider(
height: 0.5,
indent: 20,
color: Color(0xffBAC8E1),
),
ListTile(
title: Text(
"• " + AppLocalization.text("shortness.breath"),
style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
)
],
);
}

getWhenToSeekMedical() {
return Container(
padding: EdgeInsets.only(left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 20),
Text(
AppLocalization.text("when.seek.medical"),
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
Text(AppLocalization.text("if.you.develop"),
style: TextStyle(fontSize: 17)),
SizedBox(height: 10),
ListTile(
title: Text(
"• Trouble breathing",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
),
Divider(
height: 0.5,
indent: 20,
color: Color(0xffBAC8E1),
),
ListTile(
title: Text(
"• Persistent pain or pressure in the chest",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
),
Divider(
height: 0.5,
indent: 20,
color: Color(0xffBAC8E1),
),
ListTile(
title: Text(
"• New confusion or inability to around",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
),
Divider(
height: 0.5,
indent: 20,
color: Color(0xffBAC8E1),
),
ListTile(
title: Text(
"• Bluish lips or face",
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),
)
],
),
color: Color(0xffF3F4FC),
);
}

getHowToProtect() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ListTile(
title: Text(
"Learn how to protect yourself",
style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
),
trailing: Icon(Icons.arrow_forward_ios),
),
Divider(
height: 0.5,
color: Color(0xffBAC8E1),
indent: 20,
),
SizedBox(
height: 10,
),
ListTile(
title: Text("How to care for someone who is sick",
style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold)),
trailing: Icon(Icons.arrow_forward_ios),
),
Divider(
height: 0.5,
color: Color(0xffBAC8E1),
indent: 20,
),
SizedBox(
height: 10,
),
ListTile(
title: Text("What to do if you are sick",
style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold)),
trailing: Icon(Icons.arrow_forward_ios),
),
Divider(
height: 0.5,
color: Color(0xffBAC8E1),
indent: 20,
),
],
);
}

Widget bottomContent(BuildContext context) {
return Column(
children: <Widget>[
SizedBox(height: 30),
Container(
child: Material(
child: MaterialButton(
height: 50,
minWidth: MediaQuery.of(context).size.width * 0.85,
color: Color(0xff475DF3),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Text(
AppLocalization.text(
"next",
),
style: TextStyle(color: Colors.white, fontSize: 17),
),
onPressed: () {
onNextScreen.call(HomeConfirmProcessSick(
isSick: true,
onNextScreen: onNextScreen,
));
},
),
),
margin: EdgeInsets.only(bottom: 20),
),
Container(
child: MaterialButton(
height: 50,
minWidth: MediaQuery.of(context).size.width * 0.85,
color: Color(0xffDFE3FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Text(
AppLocalization.text(
"go.back",
),
style: TextStyle(color: Color(0xff475DF3), fontSize: 17),
),
onPressed: () {
onNextScreen.call(null);
},
),
margin: EdgeInsets.only(bottom: 20),
)
],
);
}
}
Loading