Commit ac99a794 authored by Piyumi Dayarathna's avatar Piyumi Dayarathna 💬

Modifications in STracker

parent 15008cc1
No preview for this file type
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "covidefender",
"request": "launch",
"type": "dart"
},
{
"name": "covidefender (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
\ No newline at end of file
...@@ -76,11 +76,81 @@ class _homepageState extends State<homepage> { ...@@ -76,11 +76,81 @@ class _homepageState extends State<homepage> {
appBar: AppBar( appBar: AppBar(
title: Text("STracker"), title: Text("STracker"),
), ),
body: ListView( body: Column(
children: <Widget>[ 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> { ...@@ -90,7 +90,7 @@ class _quizpageState extends State<quizpage> {
canceltimer = false; canceltimer = false;
timer = 60; timer = 60;
setState(() { setState(() {
if (i < 5) { if (i < 8) {
i++; i++;
} else { } else {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
...@@ -107,7 +107,7 @@ class _quizpageState extends State<quizpage> { ...@@ -107,7 +107,7 @@ class _quizpageState extends State<quizpage> {
void checkanswer(String k) { void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) { if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5; marks = marks + 15;
colortoshow = right; colortoshow = right;
} else { } else {
colortoshow = wrong; colortoshow = wrong;
...@@ -131,15 +131,20 @@ class _quizpageState extends State<quizpage> { ...@@ -131,15 +131,20 @@ class _quizpageState extends State<quizpage> {
hangState = 3; hangState = 3;
} else if (x == 4) { } else if (x == 4) {
hangState = 4; hangState = 4;
} else { } else if (x == 5) {
hangState = 5; hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => resultpage(marks: marks),
));
} }
} }
Widget choicebutton(String k) { Widget choicebutton(String k) {
return Padding( return Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
child: MaterialButton( child: MaterialButton(
...@@ -148,15 +153,15 @@ class _quizpageState extends State<quizpage> { ...@@ -148,15 +153,15 @@ class _quizpageState extends State<quizpage> {
mydata[1][i.toString()][k], mydata[1][i.toString()][k],
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 20.0,
), ),
maxLines: 1, maxLines: 1,
), ),
color: btncolor[k], color: btncolor[k],
splashColor: Colors.indigo[700], splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700], highlightColor: Colors.indigo[700],
minWidth: 200.0, minWidth: 500.0,
height: 45.0, height: 70.0,
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
), ),
...@@ -191,19 +196,22 @@ class _quizpageState extends State<quizpage> { ...@@ -191,19 +196,22 @@ class _quizpageState extends State<quizpage> {
child: Scaffold( child: Scaffold(
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
SizedBox(
height: 20,
),
Expanded( Expanded(
flex: 5, flex: 4,
child: Material( child: Material(
elevation: 20.0, elevation: 20.0,
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 150.0, height: 50.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Material( Material(
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 200.0, height: 375.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -216,15 +224,18 @@ class _quizpageState extends State<quizpage> { ...@@ -216,15 +224,18 @@ class _quizpageState extends State<quizpage> {
)), )),
), ),
), ),
SizedBox(
height: 20,
),
Expanded( Expanded(
flex: 2, flex: 1,
child: Container( child: Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
mydata[0][i.toString()], mydata[0][i.toString()],
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
...@@ -234,7 +245,7 @@ class _quizpageState extends State<quizpage> { ...@@ -234,7 +245,7 @@ class _quizpageState extends State<quizpage> {
), ),
), ),
Expanded( Expanded(
flex: 6, flex: 5,
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
......
...@@ -29,31 +29,40 @@ class _resultpageState extends State<resultpage> { ...@@ -29,31 +29,40 @@ class _resultpageState extends State<resultpage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
"Result", "Result - Hand Washing",
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 7, flex: 2,
child: Material( child: Row(
elevation: 10.0, mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[],
width: 300.0, ),
height: 300.0, ),
child: Column( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Material( RaisedButton(
child: Container( color: Colors.white,
width: 300.0, onPressed: () {},
height: 300.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: image: AssetImage(
AssetImage("lib/assets/images/gameover.jpg"), "lib/assets/images/gameover.gif",
), ),
), ),
), ),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -64,21 +73,20 @@ class _resultpageState extends State<resultpage> { ...@@ -64,21 +73,20 @@ class _resultpageState extends State<resultpage> {
child: Text( child: Text(
"You Scored $marks marks", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w900,
), ),
), ),
))
],
)), )),
),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
OutlineButton( RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(), builder: (context) => levelsDashboard(),
...@@ -87,21 +95,18 @@ class _resultpageState extends State<resultpage> { ...@@ -87,21 +95,18 @@ class _resultpageState extends State<resultpage> {
child: Text( child: Text(
"Continue", "Continue",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.0, horizontal: 200.0,
), ),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
) )
], ],
), ),
) )
], ],
), ));
);
} }
} }
...@@ -91,7 +91,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -91,7 +91,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
canceltimer = false; canceltimer = false;
timer = 60; timer = 60;
setState(() { setState(() {
if (i < 5) { if (i < 8) {
i++; i++;
} else { } else {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
...@@ -108,7 +108,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -108,7 +108,7 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
void checkanswer(String k) { void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) { if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5; marks = marks + 20;
colortoshow = right; colortoshow = right;
} else { } else {
colortoshow = wrong; colortoshow = wrong;
...@@ -132,15 +132,20 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -132,15 +132,20 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
hangState = 3; hangState = 3;
} else if (x == 4) { } else if (x == 4) {
hangState = 4; hangState = 4;
} else { } else if (x == 5) {
hangState = 5; hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => maskWearingResultPage(marks: marks),
));
} }
} }
Widget choicebutton(String k) { Widget choicebutton(String k) {
return Padding( return Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
child: MaterialButton( child: MaterialButton(
...@@ -149,15 +154,15 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -149,15 +154,15 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
mydata[1][i.toString()][k], mydata[1][i.toString()][k],
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 20.0,
), ),
maxLines: 1, maxLines: 1,
), ),
color: btncolor[k], color: btncolor[k],
splashColor: Colors.indigo[700], splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700], highlightColor: Colors.indigo[700],
minWidth: 200.0, minWidth: 500.0,
height: 45.0, height: 70.0,
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
), ),
...@@ -193,18 +198,18 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -193,18 +198,18 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 5, flex: 4,
child: Material( child: Material(
elevation: 20.0, elevation: 20.0,
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 150.0, height: 50.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Material( Material(
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 200.0, height: 375.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -218,14 +223,14 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> { ...@@ -218,14 +223,14 @@ class _quizpageMaskWearingState extends State<quizpageMaskWearing> {
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 1,
child: Container( child: Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
mydata[0][i.toString()], mydata[0][i.toString()],
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
......
...@@ -4,7 +4,8 @@ import 'package:flutter/services.dart'; ...@@ -4,7 +4,8 @@ import 'package:flutter/services.dart';
class maskWearingQuizStartPage extends StatefulWidget { class maskWearingQuizStartPage extends StatefulWidget {
@override @override
_maskWearingQuizStartPageState createState() => _maskWearingQuizStartPageState(); _maskWearingQuizStartPageState createState() =>
_maskWearingQuizStartPageState();
} }
class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> { class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> {
...@@ -76,11 +77,81 @@ class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> { ...@@ -76,11 +77,81 @@ class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> {
appBar: AppBar( appBar: AppBar(
title: Text("STracker"), title: Text("STracker"),
), ),
body: ListView( body: Column(
children: <Widget>[ 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> { ...@@ -29,30 +29,39 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
"Result for Mask Wearing", "Result - Mask Wearing",
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 7, flex: 2,
child: Material( child: Row(
elevation: 10.0, mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[],
width: 300.0, ),
height: 300.0, ),
child: Column( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Material( RaisedButton(
child: Container( color: Colors.white,
width: 300.0, onPressed: () {},
height: 300.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: image: AssetImage(
AssetImage("lib/assets/images/gameover.jpg"), "lib/assets/images/gameover.gif",
),
),
), ),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
), ),
)
],
), ),
), ),
Padding( Padding(
...@@ -64,21 +73,20 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> { ...@@ -64,21 +73,20 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
child: Text( child: Text(
"You Scored $marks marks", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w900,
), ),
), ),
)), )),
],
)),
),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
OutlineButton( RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(), builder: (context) => levelsDashboard(),
...@@ -87,21 +95,18 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> { ...@@ -87,21 +95,18 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
child: Text( child: Text(
"Continue", "Continue",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.0, horizontal: 200.0,
), ),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
) )
], ],
), ),
) )
], ],
), ));
);
} }
} }
...@@ -91,7 +91,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -91,7 +91,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
canceltimer = false; canceltimer = false;
timer = 60; timer = 60;
setState(() { setState(() {
if (i < 5) { if (i < 8) {
i++; i++;
} else { } else {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
...@@ -108,7 +108,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -108,7 +108,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
void checkanswer(String k) { void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) { if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5; marks = marks + 10;
colortoshow = right; colortoshow = right;
} else { } else {
colortoshow = wrong; colortoshow = wrong;
...@@ -132,15 +132,20 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -132,15 +132,20 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
hangState = 3; hangState = 3;
} else if (x == 4) { } else if (x == 4) {
hangState = 4; hangState = 4;
} else { } else if (x == 5) {
hangState = 5; hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => publicPlacesResultPage(marks: marks),
));
} }
} }
Widget choicebutton(String k) { Widget choicebutton(String k) {
return Padding( return Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
child: MaterialButton( child: MaterialButton(
...@@ -149,15 +154,15 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -149,15 +154,15 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
mydata[1][i.toString()][k], mydata[1][i.toString()][k],
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 20.0,
), ),
maxLines: 1, maxLines: 1,
), ),
color: btncolor[k], color: btncolor[k],
splashColor: Colors.indigo[700], splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700], highlightColor: Colors.indigo[700],
minWidth: 200.0, minWidth: 500.0,
height: 45.0, height: 70.0,
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
), ),
...@@ -193,18 +198,18 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -193,18 +198,18 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 5, flex: 4,
child: Material( child: Material(
elevation: 20.0, elevation: 20.0,
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 150.0, height: 50.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Material( Material(
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 200.0, height: 375.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -218,14 +223,14 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> { ...@@ -218,14 +223,14 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 1,
child: Container( child: Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
mydata[0][i.toString()], mydata[0][i.toString()],
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
......
...@@ -4,7 +4,8 @@ import 'package:flutter/services.dart'; ...@@ -4,7 +4,8 @@ import 'package:flutter/services.dart';
class publicPlacesQuizStartPage extends StatefulWidget { class publicPlacesQuizStartPage extends StatefulWidget {
@override @override
_publicPlacesQuizStartPageState createState() => _publicPlacesQuizStartPageState(); _publicPlacesQuizStartPageState createState() =>
_publicPlacesQuizStartPageState();
} }
class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> { class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
...@@ -76,11 +77,81 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> { ...@@ -76,11 +77,81 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
appBar: AppBar( appBar: AppBar(
title: Text("STracker"), title: Text("STracker"),
), ),
body: ListView( body: Column(
children: <Widget>[ 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'; ...@@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart'; import '../levelsDashboard.dart';
import '../variables.dart'; import '../variables.dart';
class publicPlacesResultPage extends StatefulWidget { class publicPlacesResultPage extends StatefulWidget {
int marks; int marks;
publicPlacesResultPage({Key key, @required this.marks}) : super(key: key); publicPlacesResultPage({Key key, @required this.marks}) : super(key: key);
@override @override
_publicPlacesResultPageState createState() => _publicPlacesResultPageState(marks); _publicPlacesResultPageState createState() =>
_publicPlacesResultPageState(marks);
} }
class _publicPlacesResultPageState extends State<publicPlacesResultPage> { class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
...@@ -29,31 +29,40 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> { ...@@ -29,31 +29,40 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
"Result for Public Places", "Result - Behavioural in Public Places",
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 7, flex: 2,
child: Material( child: Row(
elevation: 10.0, mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[],
width: 300.0, ),
height: 300.0, ),
child: Column( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Material( RaisedButton(
child: Container( color: Colors.white,
width: 300.0, onPressed: () {},
height: 300.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: image: AssetImage(
AssetImage("lib/assets/images/gameover.jpg"), "lib/assets/images/gameover.gif",
), ),
), ),
), ),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -64,21 +73,20 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> { ...@@ -64,21 +73,20 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
child: Text( child: Text(
"You Scored $marks marks", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w900,
), ),
), ),
)), )),
],
)),
),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
OutlineButton( RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(), builder: (context) => levelsDashboard(),
...@@ -87,21 +95,18 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> { ...@@ -87,21 +95,18 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
child: Text( child: Text(
"Continue", "Continue",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.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 ...@@ -5,7 +5,6 @@ import 'package:covidefender/STracker/SocialDistance/socialDistanceResultPage.da
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class getjsonSocialDistance extends StatelessWidget { class getjsonSocialDistance extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -37,7 +36,8 @@ class quizpageSocialDistance extends StatefulWidget { ...@@ -37,7 +36,8 @@ class quizpageSocialDistance extends StatefulWidget {
quizpageSocialDistance({Key key, @required this.mydata}) : super(key: key); quizpageSocialDistance({Key key, @required this.mydata}) : super(key: key);
@override @override
_quizpageSocialDistanceState createState() => _quizpageSocialDistanceState(mydata); _quizpageSocialDistanceState createState() =>
_quizpageSocialDistanceState(mydata);
} }
class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
...@@ -91,7 +91,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -91,7 +91,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
canceltimer = false; canceltimer = false;
timer = 60; timer = 60;
setState(() { setState(() {
if (i < 5) { if (i < 8) {
i++; i++;
} else { } else {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
...@@ -108,7 +108,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -108,7 +108,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
void checkanswer(String k) { void checkanswer(String k) {
if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) { if (mydata[2][i.toString()] == mydata[1][i.toString()][k]) {
marks = marks + 5; marks = marks + 20;
colortoshow = right; colortoshow = right;
} else { } else {
colortoshow = wrong; colortoshow = wrong;
...@@ -132,15 +132,20 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -132,15 +132,20 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
hangState = 3; hangState = 3;
} else if (x == 4) { } else if (x == 4) {
hangState = 4; hangState = 4;
} else { } else if (x == 5) {
hangState = 5; hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => socialDistanceResultPage(marks: marks),
));
} }
} }
Widget choicebutton(String k) { Widget choicebutton(String k) {
return Padding( return Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
child: MaterialButton( child: MaterialButton(
...@@ -149,15 +154,15 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -149,15 +154,15 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
mydata[1][i.toString()][k], mydata[1][i.toString()][k],
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 20.0,
), ),
maxLines: 1, maxLines: 1,
), ),
color: btncolor[k], color: btncolor[k],
splashColor: Colors.indigo[700], splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700], highlightColor: Colors.indigo[700],
minWidth: 200.0, minWidth: 500.0,
height: 45.0, height: 70.0,
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
), ),
...@@ -193,18 +198,18 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -193,18 +198,18 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 5, flex: 4,
child: Material( child: Material(
elevation: 20.0, elevation: 20.0,
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 150.0, height: 50.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Material( Material(
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 200.0, height: 375.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -218,14 +223,14 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> { ...@@ -218,14 +223,14 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 1,
child: Container( child: Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
mydata[0][i.toString()], mydata[0][i.toString()],
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
......
...@@ -4,10 +4,12 @@ import 'package:flutter/services.dart'; ...@@ -4,10 +4,12 @@ import 'package:flutter/services.dart';
class socialDistanceQuizStartPage extends StatefulWidget { class socialDistanceQuizStartPage extends StatefulWidget {
@override @override
_socialDistanceQuizStartPageState createState() => _socialDistanceQuizStartPageState(); _socialDistanceQuizStartPageState createState() =>
_socialDistanceQuizStartPageState();
} }
class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPage> { class _socialDistanceQuizStartPageState
extends State<socialDistanceQuizStartPage> {
List<String> images = [ List<String> images = [
"lib/assets/images/startQuiz.png", "lib/assets/images/startQuiz.png",
]; ];
...@@ -76,11 +78,81 @@ class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPag ...@@ -76,11 +78,81 @@ class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPag
appBar: AppBar( appBar: AppBar(
title: Text("STracker"), title: Text("STracker"),
), ),
body: ListView( body: Column(
children: <Widget>[ 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'; ...@@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart'; import '../levelsDashboard.dart';
import '../variables.dart'; import '../variables.dart';
class socialDistanceResultPage extends StatefulWidget { class socialDistanceResultPage extends StatefulWidget {
int marks; int marks;
socialDistanceResultPage({Key key, @required this.marks}) : super(key: key); socialDistanceResultPage({Key key, @required this.marks}) : super(key: key);
@override @override
_socialDistanceResultPageState createState() => _socialDistanceResultPageState(marks); _socialDistanceResultPageState createState() =>
_socialDistanceResultPageState(marks);
} }
class _socialDistanceResultPageState extends State<socialDistanceResultPage> { class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
...@@ -29,31 +29,40 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> { ...@@ -29,31 +29,40 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
"Result for Social Distance", "Result - Social Distance",
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 7, flex: 2,
child: Material( child: Row(
elevation: 10.0, mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[],
width: 300.0, ),
height: 300.0, ),
child: Column( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Material( RaisedButton(
child: Container( color: Colors.white,
width: 300.0, onPressed: () {},
height: 300.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: image: AssetImage(
AssetImage("lib/assets/images/gameover.jpg"), "lib/assets/images/gameover.gif",
), ),
), ),
), ),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -64,21 +73,20 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> { ...@@ -64,21 +73,20 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
child: Text( child: Text(
"You Scored $marks marks", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w900,
), ),
), ),
)), )),
],
)),
),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
OutlineButton( RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(), builder: (context) => levelsDashboard(),
...@@ -87,21 +95,18 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> { ...@@ -87,21 +95,18 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
child: Text( child: Text(
"Continue", "Continue",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.0, horizontal: 200.0,
), ),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
) )
], ],
), ),
) )
], ],
), ));
);
} }
} }
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:covidefender/STracker/SocialDistance/socialDistanceResultPage.dart';
import 'package:covidefender/STracker/Symptoms/symptomsResultPage.dart'; import 'package:covidefender/STracker/Symptoms/symptomsResultPage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class getjsonSymptoms extends StatelessWidget { class getjsonSymptoms extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -92,7 +90,7 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> { ...@@ -92,7 +90,7 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
canceltimer = false; canceltimer = false;
timer = 60; timer = 60;
setState(() { setState(() {
if (i < 5) { if (i < 8) {
i++; i++;
} else { } else {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
...@@ -133,15 +131,20 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> { ...@@ -133,15 +131,20 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
hangState = 3; hangState = 3;
} else if (x == 4) { } else if (x == 4) {
hangState = 4; hangState = 4;
} else { } else if (x == 5) {
hangState = 5; hangState = 5;
} else if (x == 6) {
hangState = 6;
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => symptomsResultPage(marks: marks),
));
} }
} }
Widget choicebutton(String k) { Widget choicebutton(String k) {
return Padding( return Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 20.0, horizontal: 20.0,
), ),
child: MaterialButton( child: MaterialButton(
...@@ -150,15 +153,15 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> { ...@@ -150,15 +153,15 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
mydata[1][i.toString()][k], mydata[1][i.toString()][k],
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 20.0,
), ),
maxLines: 1, maxLines: 1,
), ),
color: btncolor[k], color: btncolor[k],
splashColor: Colors.indigo[700], splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700], highlightColor: Colors.indigo[700],
minWidth: 200.0, minWidth: 500.0,
height: 45.0, height: 70.0,
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
), ),
...@@ -194,18 +197,18 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> { ...@@ -194,18 +197,18 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 5, flex: 4,
child: Material( child: Material(
elevation: 20.0, elevation: 20.0,
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 150.0, height: 50.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Material( Material(
child: Container( child: Container(
width: 200.0, width: 400.0,
height: 200.0, height: 375.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -219,14 +222,14 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> { ...@@ -219,14 +222,14 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 1,
child: Container( child: Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
mydata[0][i.toString()], mydata[0][i.toString()],
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 20.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
......
...@@ -77,11 +77,81 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> { ...@@ -77,11 +77,81 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> {
appBar: AppBar( appBar: AppBar(
title: Text("STracker"), title: Text("STracker"),
), ),
body: ListView( body: Column(
children: <Widget>[ 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'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import '../levelsDashboard.dart'; import '../levelsDashboard.dart';
import '../variables.dart'; import '../variables.dart';
class symptomsResultPage extends StatefulWidget { class symptomsResultPage extends StatefulWidget {
int marks; int marks;
symptomsResultPage({Key key, @required this.marks}) : super(key: key); symptomsResultPage({Key key, @required this.marks}) : super(key: key);
...@@ -29,31 +28,40 @@ class _symptomsResultPageState extends State<symptomsResultPage> { ...@@ -29,31 +28,40 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
"Result for Social Distance", "Result - Symptoms",
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 7, flex: 2,
child: Material( child: Row(
elevation: 10.0, mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[],
width: 300.0, ),
height: 300.0, ),
child: Column( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Material( RaisedButton(
child: Container( color: Colors.white,
width: 300.0, onPressed: () {},
height: 300.0,
child: ClipRRect( child: ClipRRect(
child: Image( child: Image(
image: image: AssetImage(
AssetImage("lib/assets/images/gameover.jpg"), "lib/assets/images/gameover.gif",
), ),
), ),
), ),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -64,21 +72,20 @@ class _symptomsResultPageState extends State<symptomsResultPage> { ...@@ -64,21 +72,20 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
child: Text( child: Text(
"You Scored $marks marks", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 30.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w900,
), ),
), ),
)), )),
],
)),
),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
OutlineButton( RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () { onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(), builder: (context) => levelsDashboard(),
...@@ -87,21 +94,18 @@ class _symptomsResultPageState extends State<symptomsResultPage> { ...@@ -87,21 +94,18 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
child: Text( child: Text(
"Continue", "Continue",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.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> { ...@@ -72,7 +72,7 @@ class _levelsDashboardState extends State<levelsDashboard> {
Card( Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)), borderRadius: BorderRadius.circular(8)),
elevation: 4, elevation: 10,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
...@@ -85,10 +85,17 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -85,10 +85,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/handWashing.png'), 'lib/assets/images/handWashing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Hand Washing', Text('Hand Washing',
style: TextStyle(fontSize: 20.0)), style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
)),
], ],
)), )),
Card( Card(
...@@ -108,10 +115,17 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -108,10 +115,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/maskWearing.png'), 'lib/assets/images/maskWearing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Mask Wearing', Text('Mask Wearing',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
], ],
)), )),
Card( Card(
...@@ -131,10 +145,17 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -131,10 +145,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/socialDistance.png'), 'lib/assets/images/socialDistance.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Socila Distance', Text('Socila Distance',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
], ],
)), )),
Card( Card(
...@@ -154,10 +175,17 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -154,10 +175,17 @@ class _levelsDashboardState extends State<levelsDashboard> {
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/publicPlaces.png'), 'lib/assets/images/publicPlaces.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Public Places', Text('Public Places',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
], ],
)), )),
Card( Card(
...@@ -171,14 +199,23 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -171,14 +199,23 @@ class _levelsDashboardState extends State<levelsDashboard> {
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => symptomsQuizStartPage()), MaterialPageRoute(
builder: (context) =>
symptomsQuizStartPage()),
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/symptoms.png'), 'lib/assets/images/symptoms.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Symptoms', Text('Symptoms',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700,
))
], ],
)), )),
Card( Card(
...@@ -192,14 +229,21 @@ class _levelsDashboardState extends State<levelsDashboard> { ...@@ -192,14 +229,21 @@ class _levelsDashboardState extends State<levelsDashboard> {
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => finalResult()), MaterialPageRoute(
builder: (context) => finalResult()),
); );
}, },
child: Image.asset( child: Image.asset(
'lib/assets/images/symptoms.png'), 'lib/assets/images/result.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Final Result', Text('Final Result',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700))
], ],
)), )),
], ],
......
...@@ -58,6 +58,21 @@ class _strackerDasboardState extends State<strackerDasboard> { ...@@ -58,6 +58,21 @@ class _strackerDasboardState extends State<strackerDasboard> {
), ),
), ),
Expanded( Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
radius: 100,
backgroundColor: Colors.transparent,
backgroundImage:
AssetImage('lib/assets/images/stracker.PNG'),
),
],
),
),
Expanded(
flex: 9,
child: GridView.count( child: GridView.count(
mainAxisSpacing: 10, mainAxisSpacing: 10,
crossAxisSpacing: 10, crossAxisSpacing: 10,
...@@ -76,13 +91,21 @@ class _strackerDasboardState extends State<strackerDasboard> { ...@@ -76,13 +91,21 @@ class _strackerDasboardState extends State<strackerDasboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => levelsDashboard()), builder: (context) =>
levelsDashboard()),
); );
}, },
child: child: Image.asset(
Image.asset('lib/assets/images/play.png'), 'lib/assets/images/play.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Play', style: TextStyle(fontSize: 20.0)), Text('Play',
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700)),
], ],
)), )),
Card( Card(
...@@ -100,10 +123,16 @@ class _strackerDasboardState extends State<strackerDasboard> { ...@@ -100,10 +123,16 @@ class _strackerDasboardState extends State<strackerDasboard> {
// ); // );
// }, // },
child: Image.asset( child: Image.asset(
'lib/assets/images/instructions.png'), 'lib/assets/images/instructions.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Instructions', Text('Instructions',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700))
], ],
)), )),
Card( Card(
...@@ -121,10 +150,16 @@ class _strackerDasboardState extends State<strackerDasboard> { ...@@ -121,10 +150,16 @@ class _strackerDasboardState extends State<strackerDasboard> {
// ); // );
// }, // },
child: Image.asset( child: Image.asset(
'lib/assets/images/score.png'), 'lib/assets/images/score.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Score Board', Text('Score Board',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700))
], ],
)), )),
Card( Card(
...@@ -142,10 +177,16 @@ class _strackerDasboardState extends State<strackerDasboard> { ...@@ -142,10 +177,16 @@ class _strackerDasboardState extends State<strackerDasboard> {
// ); // );
// }, // },
child: Image.asset( child: Image.asset(
'lib/assets/images/awrenessLevel.png'), 'lib/assets/images/awrenessLevel.png',
fit: BoxFit.contain,
width: 200,
height: 200,
),
), ),
Text('Awreness Level', Text('Awreness Level',
style: TextStyle(fontSize: 20.0)) style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w700))
], ],
)), )),
], ],
......
...@@ -4,3 +4,5 @@ int marks2 = 0; ...@@ -4,3 +4,5 @@ int marks2 = 0;
int marks3 = 0; int marks3 = 0;
int marks4 = 0; int marks4 = 0;
int marks5 = 0; int marks5 = 0;
String marks6 = '';
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
"2": "Question 2: What is the best tap to wash your hands on this Covid 19 disaster situation?", "2": "Question 2: What is the best tap to wash your hands on this Covid 19 disaster situation?",
"3": "Question 3: When you come home after visiting public places, is it your duty to clean your hands first?", "3": "Question 3: When you come home after visiting public places, is it your duty to clean your hands first?",
"4": "Question 4: You must wash and clean your hands before eating something? Is this a good habit?", "4": "Question 4: You must wash and clean your hands before eating something? Is this a good habit?",
"5": "Question 5: What is good for clean your hands" "5": "Question 5: What is good for clean your hands?",
"6": "Question 6: Is it good to clean your hands after you visit a supermarket?",
"7": "Question 7: Can the coronavirus disease spread through hands of a person",
"8": "Question 8: How much time is good for wash hands with soap and water"
}, },
{ {
"1": { "1": {
...@@ -36,6 +39,24 @@ ...@@ -36,6 +39,24 @@
"b": "Filtered water", "b": "Filtered water",
"c": "Clean, running water", "c": "Clean, running water",
"d": "Well water" "d": "Well water"
},
"6": {
"a": "No need to do always",
"b": "Not applicable",
"c": "Yes. must to do",
"d": "Sometimes"
},
"7": {
"a": "Yes, It has a major posibility",
"b": "Yes, It has a minor posibility",
"c": "No, It can not be hapen",
"d": "No, It is not applicable"
},
"8": {
"a": "At least 05 seconds",
"b": "At least 20 minutes",
"c": "At least 20 seconds",
"d": "At least 10 minutes"
} }
}, },
{ {
...@@ -43,6 +64,9 @@ ...@@ -43,6 +64,9 @@
"2": "Operate by leg", "2": "Operate by leg",
"3": "Yes, it is must", "3": "Yes, it is must",
"4": "Yes. must to do", "4": "Yes. must to do",
"5": "Clean, running water" "5": "Clean, running water",
"6": "Yes. must to do",
"7": "Yes, It has a major posibility",
"8": "At least 20 seconds"
} }
] ]
\ No newline at end of file
[ [
{ {
"1": "Question 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "1": "Question 1: Does wearing mask help to reduce the spread of Covid 19?",
"2": "Question 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "2": "Question 2: Do you wear a mask when you go out in public?",
"3": "Question 3: ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "3": "Question 3: When choosing a mask how important its comfort and fit ( to your particular face shape )?",
"4": "Question 4: ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", "4": "Question 4: What is the type of mask that you wear usually?",
"5": "Question 5: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" "5": "Question 5: How important is changing the mask daily in reducing the possibility of transmitting infection to myself and to others?",
"6": "Question 6: Do you have adequate knowledge about how to wear a mask properly?",
"7": "Question 7: Do you cover the nose while wearing the mask?",
"8": "Question 8: How important is it to dispose the used mask properly?"
}, },
{ {
"1": { "1": {
"a": "Keep my hands beautiful", "a": "Yes a lot",
"b": "Wash my hands of germs", "b": "Yes some",
"c": "To get smooth feel to hand", "c": "Not sure",
"d": "To get a new look on hand" "d": "No it does nothing"
}, },
"2": { "2": {
"a": "Operate by hand", "a": "Yes, sometimes",
"b": "Operate by mouth", "b": "I dont remember",
"c": "Operate by nose", "c": "Yes, always",
"d": "Operate by leg" "d": "Never"
}, },
"3": { "3": {
"a": "May be", "a": "Not important",
"b": "Sometimes", "b": "Little important",
"c": "Yes, it is must", "c": "Important",
"d": "Never" "d": "Never"
}, },
"4": { "4": {
"a": "Yes. must to do", "a": "Clothing mask",
"b": "Sometimes", "b": "Surgical mask",
"c": "No need to do always", "c": "N95 mask",
"d": "Not applicable" "d": "Non of this"
}, },
"5": { "5": {
"a": "Tank water", "a": "Very important",
"b": "Filtered water", "b": "Important",
"c": "Clean, running water", "c": "Little important",
"d": "Well water" "d": "Not important"
},
"6": {
"a": "no, nothing",
"b": "Not sure",
"c": "Yes, some knowledge",
"d": "Yes, very good knowledge"
},
"7": {
"a": "Never",
"b": "Yes, sometimes",
"c": "Yes, always",
"d": "I dont remember"
},
"8": {
"a": "Not important",
"b": "Little important",
"c": "Imporatant",
"d": "Very important"
} }
}, },
{ {
"1": "Wash my hands of germs", "1": "Yes a lot",
"2": "Operate by leg", "2": "Yes, always",
"3": "Yes, it is must", "3": "Very important",
"4": "Yes. must to do", "4": "N95 mask",
"5": "Clean, running water" "5": "Very important",
"6": "Yes, very good knowledge",
"7": "Yes, always",
"8": "Very important"
} }
] ]
\ No newline at end of file
[ [
{ {
"1": "Question 1: ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp", "1": "Question 1: In recent days have you gone to any crowded places?",
"2": "Question 2: lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", "2": "Question 2: Your level of risk of infection with COVID 19?",
"3": "Question 3: sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", "3": "Question 3: Are you going to meeting your friends/ relatives in this lock down period?",
"4": "Question 4: ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", "4": "Question 4: Do you limit physical contact ( hand shaking) in public places?",
"5": "Question 5: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" "5": "Question 5: Do you eat or drink in bars and resturents in these days?",
"6": "Question 6: Do you prefer to stay at home ?",
"7": "Question 7: Do you follow the health guidelines when you are in public places?",
"8": "Question 8: How do you buy foods and other goods in this endemic period?"
}, },
{ {
"1": { "1": {
"a": "Keep my hands beautiful", "a": "Yes, a lot",
"b": "Wash my hands of germs", "b": "Yes, but few",
"c": "To get smooth feel to hand", "c": "No",
"d": "To get a new look on hand" "d": "I cant remember"
}, },
"2": { "2": {
"a": "Operate by hand", "a": "High",
"b": "Operate by mouth", "b": "Moderate",
"c": "Operate by nose", "c": "Low",
"d": "Operate by leg" "d": "Very low"
}, },
"3": { "3": {
"a": "May be", "a": "Yes, of course",
"b": "Sometimes", "b": "May be",
"c": "Yes, it is must", "c": "Never",
"d": "Never" "d": "I dont know"
}, },
"4": { "4": {
"a": "Yes. must to do", "a": "Yes, sometimes",
"b": "Sometimes", "b": "Yes, always",
"c": "No need to do always", "c": "Never",
"d": "Not applicable" "d": "I cant remember"
}, },
"5": { "5": {
"a": "Tank water", "a": "Yes, all the time",
"b": "Filtered water", "b": "May be sometimes",
"c": "Clean, running water", "c": "Never",
"d": "Well water" "d": "I cant remember"
},
"6": {
"a": "Not applicable",
"b": "Hate it",
"c": "Somewhat ok",
"d": "Yes, love it"
},
"7": {
"a": "Never",
"b": "Yes, sometimes",
"c": "Yes, always",
"d": "I cant remember"
},
"8": {
"a": "By online ordering",
"b": "By visiting to the shop",
"c": "By both methods",
"d": "Non of these methods"
} }
}, },
{ {
"1": "Wash my hands of germs", "1": "Yes, a lot",
"2": "Operate by leg", "2": "Very low",
"3": "Yes, it is must", "3": "Never",
"4": "Yes. must to do", "4": "Yes, always",
"5": "Clean, running water" "5": "Yes, all the time",
"6": "Yes, love it",
"7": "Yes, always",
"8": "By online ordering"
} }
] ]
\ No newline at end of file
[ [
{ {
"1": "Question 1: sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", "1": "Question 1: Does keeping social distance help to reduce the spread of COVID 19?",
"2": "Question 2: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "2": "Question 2: Are you practicing any kind of social distancing when you are at public places?",
"3": "Question 3: sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", "3": "Question 3: What is the ideal distance you have to maintain when you are in a crowded place?",
"4": "Question 4: ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", "4": "Question 4: Do you cover your nose and mouth during coughing or sneezing with the elbow or tissue?",
"5": "Question 5: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" "5": "Question 5: How does the COVID 19 virus spread?",
"6": "Question 6: Do you listen and follow the guidelines regarding social distancing when you are at a crowded place.",
"7": "Question 7: Do you think lockdown will improve the controlling of COVID 19?",
"8": "Question 8: Your level of knowledge in social distancing?"
}, },
{ {
"1": { "1": {
"a": "Keep my hands beautiful", "a": "No it does nothing",
"b": "Wash my hands of germs", "b": "Not sure",
"c": "To get smooth feel to hand", "c": "Yes, some",
"d": "To get a new look on hand" "d": "Yes, a lot"
}, },
"2": { "2": {
"a": "Operate by hand", "a": "Yes, sometimes",
"b": "Operate by mouth", "b": "Yes, always",
"c": "Operate by nose", "c": "Never",
"d": "Operate by leg" "d": "I cant remember"
}, },
"3": { "3": {
"a": "May be", "a": "0.5 meter distance",
"b": "Sometimes", "b": "2 meter distance",
"c": "Yes, it is must", "c": "0.2 meter distance",
"d": "Never" "d": "0.02 meter distance"
}, },
"4": { "4": {
"a": "Yes. must to do", "a": "Yes, sometimes",
"b": "Sometimes", "b": "Never",
"c": "No need to do always", "c": "Yes, always",
"d": "Not applicable" "d": "Not applicable"
}, },
"5": { "5": {
"a": "Tank water", "a": "Air borne",
"b": "Respiratory droplets and personal contact",
"c": "Animal contact",
"d": "No idea"
},
"6": {
"a": "I cant remember",
"b": "Never",
"c": "Yes, sometimes",
"d": "Yes, always"
},
"7": {
"a": "No, It will not",
"b": "Filtered water", "b": "Filtered water",
"c": "Clean, running water", "c": "Yes, absolutely",
"d": "Well water" "d": "I have no idea"
},
"8": {
"a": "High level",
"b": "Moderate level",
"c": "Low level",
"d": "Very low level"
} }
}, },
{ {
"1": "Wash my hands of germs", "1": "Yes, a lot",
"2": "Operate by leg", "2": "Yes, always",
"3": "Yes, it is must", "3": "2 meter distance",
"4": "Yes. must to do", "4": "Yes, always",
"5": "Clean, running water" "5": "Respiratory droplets and personal contact",
"6": "Yes, always",
"7": "Yes, absolutely",
"8": "High level"
} }
] ]
\ No newline at end of file
[ [
{ {
"1": "Question 1: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy", "1": "Question 1: Your knowledge about the symptoms of COVID 19 ?",
"2": "Question 2: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "2": "Question 2: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm",
"3": "Question 3: sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", "3": "Question 3: sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss",
"4": "Question 4: ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", "4": "Question 4: ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"5": "Question 5: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" "5": "Question 5: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"6": "Question 6: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"7": "Question 7: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"8": "Question 8: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}, },
{ {
"1": { "1": {
...@@ -37,12 +40,36 @@ ...@@ -37,12 +40,36 @@
"c": "Clean, running water", "c": "Clean, running water",
"d": "Well water" "d": "Well water"
} }
,
"6": {
"a": "Tank water",
"b": "Filtered water",
"c": "Clean, running water",
"d": "Well water"
}
,
"7": {
"a": "Tank water",
"b": "Filtered water",
"c": "Clean, running water",
"d": "Well water"
}
,
"8": {
"a": "Tank water",
"b": "Filtered water",
"c": "Clean, running water",
"d": "Well water"
}
}, },
{ {
"1": "Wash my hands of germs", "1": "Wash my hands of germs",
"2": "Operate by leg", "2": "Operate by leg",
"3": "Yes, it is must", "3": "Yes, it is must",
"4": "Yes. must to do", "4": "Yes. must to do",
"5": "Clean, running water" "5": "Clean, running water",
"6": "Clean, running water",
"7": "Clean, running water",
"8": "Clean, running water"
} }
] ]
\ No newline at end of file
import 'package:covidefender/I_GUIDER/splashIguider.dart'; import 'package:covidefender/I_GUIDER/splashIguider.dart';
import 'package:covidefender/STracker/splash.dart'; import 'package:covidefender/STracker/splash.dart';
import 'package:covidefender/EAnalyzer/Loading.dart'; import 'package:covidefender/EAnalyzer/Loading.dart';
import 'package:covidefender/loginPage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
...@@ -42,11 +43,11 @@ class _HomeScreenState extends State<HomeScreen> { ...@@ -42,11 +43,11 @@ class _HomeScreenState extends State<HomeScreen> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
CircleAvatar( // CircleAvatar(
radius: 32, // radius: 32,
backgroundImage: NetworkImage( // backgroundImage: NetworkImage(
'https://upload.wikimedia.org/wikipedia/commons/a/a0/Pierre-Person.jpg'), // 'https://upload.wikimedia.org/wikipedia/commons/a/a0/Pierre-Person.jpg'),
), // ),
SizedBox( SizedBox(
width: 16, width: 16,
), ),
...@@ -77,13 +78,17 @@ class _HomeScreenState extends State<HomeScreen> { ...@@ -77,13 +78,17 @@ class _HomeScreenState extends State<HomeScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( FlatButton(
height: size.height * .1, onPressed: () {
decoration: BoxDecoration( Navigator.push(
image: DecorationImage( context,
image: AssetImage( MaterialPageRoute(
'lib/assets/images/man80.png')), builder: (context) => loginPage()),
)), );
},
child: Image.asset(
'lib/assets/images/man80.png'),
),
Text('My Profile', Text('My Profile',
style: TextStyle(fontSize: 20.0)) style: TextStyle(fontSize: 20.0))
], ],
......
import 'package:covidefender/mainRegisterPage.dart';
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
class loginPage extends StatefulWidget {
@override
_loginPageState createState() => _loginPageState();
}
class _loginPageState extends State<loginPage> {
String hotelName;
String district;
int nearToDistrict;
int noOfPeople;
String date;
int ima = 0;
getHotelName(hotelName) {
this.hotelName = hotelName;
}
getDistrict(district) {
this.district = district;
}
getNearDistrict(nearToDistrict) {
this.nearToDistrict = nearToDistrict;
}
getPeople(noOfPeople) {
this.noOfPeople = noOfPeople;
}
getDate(date) {
this.date = date;
}
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
Widget _buildHotelName() {
return TextFormField(
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.indigo[900]),
borderRadius: BorderRadius.all(Radius.circular(20))),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
borderRadius: BorderRadius.all(Radius.circular(20))),
prefixIcon: Icon(Icons.home),
hintText: "Enter Username",
labelText: 'Username'),
// ignore: missing_return
validator: (String value) {},
);
}
Widget _buildDistrict() {
return TextFormField(
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.indigo[900]),
borderRadius: BorderRadius.all(Radius.circular(20))),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
borderRadius: BorderRadius.all(Radius.circular(20))),
prefixIcon: Icon(Icons.location_on),
hintText: "Enter Password",
labelText: 'Password'),
// ignore: missing_return
validator: (String value) {},
// onSaved: (String value){
// _fName = value;
// },
onChanged: (String district) {
getDistrict(district);
},
);
}
//---------------------------------------------Near To District-----------------------------------------------------
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
backgroundColor: Colors.blueAccent,
title: Text("CoviDefender"),
),
body: Container(
margin: EdgeInsets.all(24),
child: Form(
key: _formKey,
child: ListView(
scrollDirection: Axis.vertical,
//mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 100),
Padding(
padding: EdgeInsets.symmetric(
vertical: 5.0,
horizontal: 15.0,
),
child: Center(
child: Text(
"CoviDefender",
style: TextStyle(
fontSize: 50.0,
fontWeight: FontWeight.w900,
),
),
)),
CircleAvatar(
radius: 180.0,
backgroundColor: Colors.white,
child: Image(
image: AssetImage("lib/assets/images/corona.gif"),
),
),
SizedBox(height: 100),
_buildHotelName(),
SizedBox(height: 10),
_buildDistrict(),
SizedBox(height: 50),
RaisedButton(
color: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
// Navigator.of(context).pushReplacement(MaterialPageRoute(
// builder: (context) => finalOverallResultPage(),
// ));
},
child: Text(
"Login",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 150.0,
),
),
SizedBox(height: 50),
RaisedButton(
color: Colors.green,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => mainRegisterPage(),
));
},
child: Text(
"Register",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 150.0,
),
)
],
),
),
),
);
}
}
import 'package:covidefender/STracker/HandWashing/quizpage.dart';
import 'package:covidefender/STracker/splash.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class mainRegisterPage extends StatefulWidget {
@override
_mainRegisterPageState createState() => _mainRegisterPageState();
}
class _mainRegisterPageState extends State<mainRegisterPage> {
List<String> images = [
"lib/assets/images/startQuiz.png",
];
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("CoviDefender"),
),
body: Column(
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Registration",
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/register.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 5.0,
horizontal: 15.0,
),
child: Center(
child: Text(
"You have to answer a quiz before register \n Press Start Quiz to navigate.",
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.w900,
),
),
)),
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) => splashscreen(),
));
},
child: Text(
"Start Quiz",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
}
}
...@@ -108,6 +108,28 @@ flutter: ...@@ -108,6 +108,28 @@ flutter:
- lib/assets/images/4.png - lib/assets/images/4.png
- lib/assets/images/5.png - lib/assets/images/5.png
- lib/assets/images/6.png - lib/assets/images/6.png
- lib/assets/images/100.png
- lib/assets/images/200.png
- lib/assets/images/300.png
- lib/assets/images/400.png
- lib/assets/images/500.png
- lib/assets/images/start.gif
- lib/assets/images/handWashingStart.gif
- lib/assets/images/maskWearingStart.gif
- lib/assets/images/publicPlacesStart.gif
- lib/assets/images/socialDistanceStart.gif
- lib/assets/images/symStart1.gif
- lib/assets/images/symStart2.gif
- lib/assets/images/symStart3.gif
- lib/assets/images/symStart4.gif
- lib/assets/images/gameover.gif
- lib/assets/images/finalResult.gif
- lib/assets/images/awarenessLevel.gif
- lib/assets/images/login.gif
- lib/assets/images/register.gif
- lib/assets/images/corona.gif
- lib/assets/images/quizImage.gif
- lib/assets/images/result.png
- lib/assets/images/hero.gif - lib/assets/images/hero.gif
- lib/assets/images/map80.png - lib/assets/images/map80.png
......
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