Commit c15ed477 authored by indika N kumara's avatar indika N kumara

Merge branch 'develop_1' into 'EAnalyzer_KarunaratneGP'

# Conflicts:
#   .vscode/launch.json
#   android/app/src/main/AndroidManifest.xml
#   lib/EAnalyzer/AddLocation.dart
#   lib/home_screen.dart
#   pubspec.lock
#   pubspec.yaml
parents 4bd0762c 4aac3c3f
No preview for this file type
......@@ -5,11 +5,15 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"name": "covidefender",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
"type": "dart"
},
{
"name": "covidefender (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
\ No newline at end of file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.covidefender">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:label="covidefender"
android:icon="@mipmap/ic_launcher">
......@@ -33,7 +35,17 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
......
......@@ -7,44 +7,45 @@ class AddLocation extends StatefulWidget {
}
class AddLocationState extends State<AddLocation> {
String userName;
String phoneNumber;
String riskLocation;
String hotelName;
String date;
String time;
getUserName(name) {
this.userName = name;
}
String userName;
String phoneNumber;
String riskLocation;
String hotelName;
String date;
String time;
getUserName(name){
this.userName= name;
}
getPhoneNumber(pno) {
this.phoneNumber = pno;
}
getPhoneNumber(pno){
this.phoneNumber= pno;
}
getRiskLocation(location) {
this.riskLocation = location;
}
getRiskLocation(location){
this.riskLocation= location;
}
getHotelName(hotelname) {
this.hotelName = hotelname;
}
getHotelName(hotelname){
this.hotelName= hotelname;
}
getDate(date) {
this.date = date;
}
getDate(date){
this.date= date;
}
getTime(time) {
this.time = time;
}
getTime(time){
this.time= time;
}
//---------------------------------------------Create Data-----------------------------------------------------
createData(){
createData() {
print("object");
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName);
DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
Map<String, dynamic> locations ={
Map<String, dynamic> locations = {
"userName": userName,
"phoneNumber": phoneNumber,
"riskLocation": riskLocation,
......@@ -56,16 +57,15 @@ createData(){
documentReference.setData(locations).whenComplete(() {
print("$userName created");
});
}
}
//---------------------------------------------Read Data-----------------------------------------------------
readData() {
DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
readData(){
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName);
documentReference.get().then((datasnapshot){
documentReference.get().then((datasnapshot) {
print(datasnapshot.data()["userName"]);
print(datasnapshot.data()["phoneNumber"]);
print(datasnapshot.data()["riskLocation"]);
......@@ -73,16 +73,17 @@ readData(){
print(datasnapshot.data()["date"]);
print(datasnapshot.data()["time"]);
});
}
}
//---------------------------------------------Update Data-----------------------------------------------------
updateData(){
updateData() {
print("object");
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName);
DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
Map<String, dynamic> locations ={
Map<String, dynamic> locations = {
"userName": userName,
"phoneNumber": phoneNumber,
"riskLocation": riskLocation,
......@@ -94,18 +95,19 @@ updateData(){
documentReference.setData(locations).whenComplete(() {
print("$userName Updated");
});
}
}
//---------------------------------------------Delete Data-----------------------------------------------------
deleteData(){
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName);
documentReference.delete().whenComplete((){
deleteData() {
DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
documentReference.delete().whenComplete(() {
print("$userName Deleted");
});
}
}
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
//---------------------------------------------User Name-----------------------------------------------------
Widget _buildName(){
return TextFormField(
......
import 'package:covidefender/pages/heart_rate/heart_rate_screen.dart';
import 'package:covidefender/pages/mask_detect/invoker.dart';
import 'package:covidefender/pages/notificator/ui/MainNotificationUI.dart';
import 'package:covidefender/pages/notificator/ui/notificator.dart';
import 'package:covidefender/pages/self_carer/sc_main_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class I_guider extends StatelessWidget {
@override
Widget build(BuildContext context) {
final mesure = MediaQuery.of(context);
return Scaffold(
backgroundColor: Colors.grey[200],
backgroundColor: Colors.white,
appBar: AppBar(
centerTitle: true,
title: Text('I-Guider'),
// elevation: 0,
),
body: Column(
body: SingleChildScrollView(
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
height: mesure.size.height/3,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/images/hero.gif'),
fit: BoxFit.cover)),
height: 300,
),
),
],
......@@ -39,17 +46,30 @@ class I_guider extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
child: ButtonTheme(
splashColor: Colors.blue,
minWidth: 100.0,
height: 150.0,
child: RaisedButton.icon(
icon: Icon(
Icons.bluetooth_audio_rounded,
icon: Column(
children: [
Icon(
Icons.notifications,
size: 40,
color: Colors.white,
),
SizedBox(height: 20),
Text("Notificator",style:TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white
) ,)
],
),
label: Text('',
style: TextStyle(fontWeight: FontWeight.bold)),
onPressed: () {},
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => MainNotificationUI() ));
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
color: Colors.blue[200],
......@@ -65,11 +85,21 @@ class I_guider extends StatelessWidget {
height: 150.0,
child: RaisedButton.icon(
color: Colors.greenAccent,
icon: Icon(
icon: Column(
children: [
Icon(
Icons.face_unlock_sharp,
size: 60,
color: Colors.white,
),
SizedBox(height: 20),
Text("Mask Detector",style:TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white
) ,)
],
),
label: Text(
'',
style: TextStyle(fontWeight: FontWeight.bold),
......@@ -101,11 +131,20 @@ class I_guider extends StatelessWidget {
minWidth: 100.0,
height: 150.0,
child: RaisedButton.icon(
icon: Icon(
icon: Column(
children: [
Icon(
Icons.view_stream_outlined,
size: 40,
color: Colors.white,
),
SizedBox(height: 20),
Text("Heart Monitor",style:TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white
) ,)
],
),
label: Text('',
style: TextStyle(fontWeight: FontWeight.bold)),
onPressed: () {
......@@ -127,16 +166,27 @@ class I_guider extends StatelessWidget {
height: 150.0,
child: RaisedButton.icon(
color: Colors.purple[200],
icon: Icon(
icon: Column(
children: [
Icon(
Icons.online_prediction_sharp,
size: 60,
color: Colors.white,
),
SizedBox(height: 20),
Text("Self-Carer",style:TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white
) ,)
],
),
label: Text(
'',
style: TextStyle(fontWeight: FontWeight.bold),
),
onPressed: () {},
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context)=> SC_main()));
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
),
......@@ -147,6 +197,7 @@ class I_guider extends StatelessWidget {
),
],
),
),
);
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
class CustomDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)),
elevation: 0.0,
backgroundColor: Colors.white,
child: dialogContent(context),
);
}
Widget dialogContent(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 0.0, right: 0.0),
child: Stack(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 13.0, right: 8.0),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(16.0),
boxShadow: <BoxShadow>[]),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
height: 10.0,
),
Center(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: new Text("Sorry please try \n again tomorrow",
style: TextStyle(fontSize: 10.0, color: Colors.black)),
) //
),
SizedBox(height: 14.0),
],
),
),
Positioned(
right: 0.0,
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Align(
alignment: Alignment.topRight,
child: CircleAvatar(
radius: 14.0,
backgroundColor: Colors.white,
child: Icon(Icons.close, color: Colors.red),
),
),
),
),
],
),
);
}
}
This diff is collapsed.
class SecrectMapKey {
// Add your Google Maps API Key here
static const API_KEY = 'AIzaSyBuDih9ioyQAR9ikg3zEoE_5mhXvZh5oAw';
}
This diff is collapsed.
import 'package:flutter/material.dart';
class AlertBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 0.0, right: 0.0),
child: Stack(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 13.0, right: 8.0),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(16.0),
boxShadow: <BoxShadow>[]),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
height: 10.0,
),
Center(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: new Text("Sorry please try \n again tomorrow",
style: TextStyle(fontSize: 10.0, color: Colors.black)),
) //
),
SizedBox(height: 14.0),
],
),
),
Positioned(
right: 0.0,
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Align(
alignment: Alignment.topRight,
child: CircleAvatar(
radius: 14.0,
backgroundColor: Colors.white,
child: Icon(Icons.close, color: Colors.red),
),
),
),
),
],
),
);
}
}
......@@ -76,11 +76,81 @@ class _homepageState extends State<homepage> {
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
body: Column(
children: <Widget>[
customcard("Start Quiz", images[0]),
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Hand Washing",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/handWashingStart.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
);
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjson(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
......@@ -90,7 +90,7 @@ class _quizpageState extends State<quizpage> {
canceltimer = false;
timer = 60;
setState(() {
if (i < 5) {
if (i < 8) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
......@@ -107,7 +107,7 @@ class _quizpageState extends State<quizpage> {
void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5;
marks = marks + 15;
colortoshow = right;
} else {
colortoshow = wrong;
......@@ -131,15 +131,20 @@ class _quizpageState extends State<quizpage> {
hangState = 3;
} else if (x == 4) {
hangState = 4;
} else {
} else if (x == 5) {
hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => resultpage(marks: marks),
));
}
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
vertical: 20.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -148,15 +153,15 @@ class _quizpageState extends State<quizpage> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontSize: 20.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
minWidth: 500.0,
height: 70.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -191,19 +196,22 @@ class _quizpageState extends State<quizpage> {
child: Scaffold(
body: Column(
children: <Widget>[
SizedBox(
height: 20,
),
Expanded(
flex: 5,
flex: 4,
child: Material(
elevation: 20.0,
child: Container(
width: 200.0,
height: 150.0,
width: 400.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 200.0,
height: 200.0,
width: 400.0,
height: 375.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -216,15 +224,18 @@ class _quizpageState extends State<quizpage> {
)),
),
),
SizedBox(
height: 20,
),
Expanded(
flex: 2,
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......@@ -234,7 +245,7 @@ class _quizpageState extends State<quizpage> {
),
),
Expanded(
flex: 6,
flex: 5,
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
......
......@@ -29,31 +29,40 @@ class _resultpageState extends State<resultpage> {
return Scaffold(
appBar: AppBar(
title: Text(
"Result",
"Result - Hand Washing",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
image: AssetImage(
"lib/assets/images/gameover.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
padding: EdgeInsets.symmetric(
......@@ -64,21 +73,20 @@ class _resultpageState extends State<resultpage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
))
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
......@@ -87,21 +95,18 @@ class _resultpageState extends State<resultpage> {
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
vertical: 20.0,
horizontal: 200.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
));
}
}
......@@ -91,7 +91,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
canceltimer = false;
timer = 60;
setState(() {
if (i < 5) {
if (i < 8) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
......@@ -108,7 +108,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5;
marks = marks + 20;
colortoshow = right;
} else {
colortoshow = wrong;
......@@ -132,15 +132,20 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
hangState = 3;
} else if (x == 4) {
hangState = 4;
} else {
} else if (x == 5) {
hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => maskWearingResultPage(marks: marks),
));
}
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
vertical: 20.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -149,15 +154,15 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontSize: 20.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
minWidth: 500.0,
height: 70.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -193,18 +198,18 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
body: Column(
children: <Widget>[
Expanded(
flex: 5,
flex: 4,
child: Material(
elevation: 20.0,
child: Container(
width: 200.0,
height: 150.0,
width: 400.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 200.0,
height: 200.0,
width: 400.0,
height: 375.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -218,14 +223,14 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
),
),
Expanded(
flex: 2,
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -4,7 +4,8 @@ import 'package:flutter/services.dart';
class maskWearingQuizStartPage extends StatefulWidget {
@override
_maskWearingQuizStartPageState createState() => _maskWearingQuizStartPageState();
_maskWearingQuizStartPageState createState() =>
_maskWearingQuizStartPageState();
}
class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> {
......@@ -76,11 +77,81 @@ class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> {
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
body: Column(
children: <Widget>[
customcard("Start Quiz", images[0]),
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Mask Wearing",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/maskWearingStart.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
);
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjsonMaskWearing(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
......@@ -29,30 +29,39 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
return Scaffold(
appBar: AppBar(
title: Text(
"Result for Mask Wearing",
"Result - Mask Wearing",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
image: AssetImage(
"lib/assets/images/gameover.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
......@@ -64,21 +73,20 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
)),
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
......@@ -87,21 +95,18 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
vertical: 20.0,
horizontal: 200.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
));
}
}
......@@ -91,7 +91,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
canceltimer = false;
timer = 60;
setState(() {
if (i < 5) {
if (i < 8) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
......@@ -108,7 +108,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5;
marks = marks + 10;
colortoshow = right;
} else {
colortoshow = wrong;
......@@ -132,15 +132,20 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
hangState = 3;
} else if (x == 4) {
hangState = 4;
} else {
} else if (x == 5) {
hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => publicPlacesResultPage(marks: marks),
));
}
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
vertical: 20.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -149,15 +154,15 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontSize: 20.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
minWidth: 500.0,
height: 70.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -193,18 +198,18 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
body: Column(
children: <Widget>[
Expanded(
flex: 5,
flex: 4,
child: Material(
elevation: 20.0,
child: Container(
width: 200.0,
height: 150.0,
width: 400.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 200.0,
height: 200.0,
width: 400.0,
height: 375.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -218,14 +223,14 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
),
),
Expanded(
flex: 2,
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -4,7 +4,8 @@ import 'package:flutter/services.dart';
class publicPlacesQuizStartPage extends StatefulWidget {
@override
_publicPlacesQuizStartPageState createState() => _publicPlacesQuizStartPageState();
_publicPlacesQuizStartPageState createState() =>
_publicPlacesQuizStartPageState();
}
class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
......@@ -76,11 +77,81 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
body: Column(
children: <Widget>[
customcard("Start Quiz", images[0]),
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Behavioural in Public Places",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/publicPlacesStart.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
);
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjsonPublicPlaces(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
......@@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart';
import '../variables.dart';
class publicPlacesResultPage extends StatefulWidget {
int marks;
publicPlacesResultPage({Key key, @required this.marks}) : super(key: key);
@override
_publicPlacesResultPageState createState() => _publicPlacesResultPageState(marks);
_publicPlacesResultPageState createState() =>
_publicPlacesResultPageState(marks);
}
class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
......@@ -29,31 +29,40 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
return Scaffold(
appBar: AppBar(
title: Text(
"Result for Public Places",
"Result - Behavioural in Public Places",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
image: AssetImage(
"lib/assets/images/gameover.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
padding: EdgeInsets.symmetric(
......@@ -64,21 +73,20 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
)),
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
......@@ -87,21 +95,18 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
vertical: 20.0,
horizontal: 200.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
));
}
}
......@@ -5,7 +5,6 @@ import 'package:covidefender/STracker/SocialDistance/socialDistanceResultPage.da
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class getjsonSocialDistance extends StatelessWidget {
@override
Widget build(BuildContext context) {
......@@ -37,7 +36,8 @@ class quizpageSocialDistance extends StatefulWidget {
quizpageSocialDistance({Key key, @required this.mydata}) : super(key: key);
@override
_quizpageSocialDistanceState createState() => _quizpageSocialDistanceState(mydata);
_quizpageSocialDistanceState createState() =>
_quizpageSocialDistanceState(mydata);
}
class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
......@@ -91,7 +91,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
canceltimer = false;
timer = 60;
setState(() {
if (i < 5) {
if (i < 8) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
......@@ -108,7 +108,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5;
marks = marks + 20;
colortoshow = right;
} else {
colortoshow = wrong;
......@@ -132,15 +132,20 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
hangState = 3;
} else if (x == 4) {
hangState = 4;
} else {
} else if (x == 5) {
hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => socialDistanceResultPage(marks: marks),
));
}
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
vertical: 20.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -149,15 +154,15 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontSize: 20.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
minWidth: 500.0,
height: 70.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -193,18 +198,18 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
body: Column(
children: <Widget>[
Expanded(
flex: 5,
flex: 4,
child: Material(
elevation: 20.0,
child: Container(
width: 200.0,
height: 150.0,
width: 400.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 200.0,
height: 200.0,
width: 400.0,
height: 375.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -218,14 +223,14 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
),
),
Expanded(
flex: 2,
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -4,10 +4,12 @@ import 'package:flutter/services.dart';
class socialDistanceQuizStartPage extends StatefulWidget {
@override
_socialDistanceQuizStartPageState createState() => _socialDistanceQuizStartPageState();
_socialDistanceQuizStartPageState createState() =>
_socialDistanceQuizStartPageState();
}
class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPage> {
class _socialDistanceQuizStartPageState
extends State<socialDistanceQuizStartPage> {
List<String> images = [
"lib/assets/images/startQuiz.png",
];
......@@ -76,11 +78,81 @@ class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPag
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
body: Column(
children: <Widget>[
customcard("Start Quiz", images[0]),
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Social Distance",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/socialDistanceStart.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
);
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjsonSocialDistance(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
......@@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart';
import '../variables.dart';
class socialDistanceResultPage extends StatefulWidget {
int marks;
socialDistanceResultPage({Key key, @required this.marks}) : super(key: key);
@override
_socialDistanceResultPageState createState() => _socialDistanceResultPageState(marks);
_socialDistanceResultPageState createState() =>
_socialDistanceResultPageState(marks);
}
class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
......@@ -29,31 +29,40 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
return Scaffold(
appBar: AppBar(
title: Text(
"Result for Social Distance",
"Result - Social Distance",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
image: AssetImage(
"lib/assets/images/gameover.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
padding: EdgeInsets.symmetric(
......@@ -64,21 +73,20 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
)),
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
......@@ -87,21 +95,18 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
vertical: 20.0,
horizontal: 200.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
));
}
}
import 'dart:async';
import 'dart:convert';
import 'package:covidefender/STracker/SocialDistance/socialDistanceResultPage.dart';
import 'package:covidefender/STracker/Symptoms/symptomsResultPage.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class getjsonSymptoms extends StatelessWidget {
@override
Widget build(BuildContext context) {
......@@ -92,7 +90,7 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
canceltimer = false;
timer = 60;
setState(() {
if (i < 5) {
if (i < 8) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
......@@ -133,15 +131,20 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
hangState = 3;
} else if (x == 4) {
hangState = 4;
} else {
} else if (x == 5) {
hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => symptomsResultPage(marks: marks),
));
}
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
vertical: 20.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -150,15 +153,15 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontSize: 20.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
minWidth: 500.0,
height: 70.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -194,18 +197,18 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
body: Column(
children: <Widget>[
Expanded(
flex: 5,
flex: 4,
child: Material(
elevation: 20.0,
child: Container(
width: 200.0,
height: 150.0,
width: 400.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 200.0,
height: 200.0,
width: 400.0,
height: 375.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -219,14 +222,14 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
),
),
Expanded(
flex: 2,
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -77,11 +77,81 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> {
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
body: Column(
children: <Widget>[
customcard("Start Quiz", images[0]),
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Symptoms",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/symStart2.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
);
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjsonSymptoms(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
......@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart';
import '../variables.dart';
class symptomsResultPage extends StatefulWidget {
int marks;
symptomsResultPage({Key key, @required this.marks}) : super(key: key);
......@@ -29,31 +28,40 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
return Scaffold(
appBar: AppBar(
title: Text(
"Result for Social Distance",
"Result - Symptoms",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
image: AssetImage(
"lib/assets/images/gameover.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
padding: EdgeInsets.symmetric(
......@@ -64,21 +72,20 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
)),
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
......@@ -87,21 +94,18 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
vertical: 20.0,
horizontal: 200.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
));
}
}
import 'package:covidefender/STracker/HandWashing/quizpage.dart';
import 'package:covidefender/STracker/levelsDashboard.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'variables.dart';
class finalOverallResultPage extends StatefulWidget {
String marks;
finalOverallResultPage() : super();
@override
_finalOverallResultPageState createState() => _finalOverallResultPageState();
}
class _finalOverallResultPageState extends State<finalOverallResultPage> {
// int ima;
_finalOverallResultPageState();
@override
void initState() {
setLevel();
super.initState();
}
void setLevel() {
print('marks6');
print(marks6);
if(marks6 == 'Very Low'){
// ima = 100;
print('1');
}else if(marks6 == 'Low'){
// ima = 200;
print('2');
}else if(marks6 == 'Moderate'){
// ima = 300;
print('3');
}else if(marks6 == 'High'){
// ima = 400;
print('4');
}else if(marks6 == 'Very High'){
// ima = 500;
print('5');
}
}
Widget customcard(String type, String image) {
return Padding(
padding: EdgeInsets.all(
20.0,
),
child: InkWell(
onTap: () {
// Navigator.of(context).pushReplacement(MaterialPageRoute(
// builder: (context) => getjson(),
// ));
},
child: Material(
color: Colors.indigoAccent,
elevation: 10.0,
borderRadius: BorderRadius.circular(20.0),
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
),
child: Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(100.0),
child: Container(
height: 100.0,
width: 100.0,
child: ClipOval(
child: Image(
fit: BoxFit.contain,
image: AssetImage(
image,
),
),
),
),
),
),
Center(
child: Text(
type,
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w700,
),
),
),
],
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold(
appBar: AppBar(
title: Text("STracker"),
),
body: Column(
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Overall Awareness Level",
style: TextStyle(color: Colors.white, fontSize: 30),
),
),
)),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 8,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/awarenessLevel.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: Text(
"Your Awareness Level - $marks6",
style: TextStyle(color: Colors.red, fontSize: 30),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: Image(
image: AssetImage(
"lib/assets/images/100.png",
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text(
"Registration",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
This diff is collapsed.
......@@ -72,7 +72,7 @@ class _levelsDashboardState extends State<levelsDashboard> {
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
elevation: 10,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
......@@ -85,10 +85,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
);
},
child: Image.asset(
'lib/assets/images/handWashing.png'),
'lib/assets/images/handWashing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Hand Washing',
style: TextStyle(fontSize: 20.0)),
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
)),
],
)),
Card(
......@@ -108,10 +115,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
);
},
child: Image.asset(
'lib/assets/images/maskWearing.png'),
'lib/assets/images/maskWearing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Mask Wearing',
style: TextStyle(fontSize: 20.0))
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
......@@ -131,10 +145,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
);
},
child: Image.asset(
'lib/assets/images/socialDistance.png'),
'lib/assets/images/socialDistance.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Socila Distance',
style: TextStyle(fontSize: 20.0))
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
......@@ -154,10 +175,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
);
},
child: Image.asset(
'lib/assets/images/publicPlaces.png'),
'lib/assets/images/publicPlaces.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Public Places',
style: TextStyle(fontSize: 20.0))
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
......@@ -171,14 +199,23 @@ class _levelsDashboardState extends State<levelsDashboard> {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => symptomsQuizStartPage()),
MaterialPageRoute(
builder: (context) =>
symptomsQuizStartPage()),
);
},
child: Image.asset(
'lib/assets/images/symptoms.png'),
'lib/assets/images/symptoms.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Symptoms',
style: TextStyle(fontSize: 20.0))
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
......@@ -192,14 +229,21 @@ class _levelsDashboardState extends State<levelsDashboard> {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => finalResult()),
MaterialPageRoute(
builder: (context) => finalResult()),
);
},
child: Image.asset(
'lib/assets/images/symptoms.png'),
'lib/assets/images/result.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
),
Text('Final Result',
style: TextStyle(fontSize: 20.0))
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700))
],
)),
],
......
This diff is collapsed.
......@@ -4,3 +4,5 @@ int marks2 = 0;
int marks3 = 0;
int marks4 = 0;
int marks5 = 0;
String marks6 = '';
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment