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 @@ ...@@ -5,11 +5,15 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Python: Current File", "name": "covidefender",
"type": "python",
"request": "launch", "request": "launch",
"program": "${file}", "type": "dart"
"console": "integratedTerminal" },
{
"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" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.covidefender"> package="com.example.covidefender">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application <application
android:label="covidefender" android:label="covidefender"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY" <meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBuDih9ioyQAR9ikg3zEoE_5mhXvZh5oAw"/> android:value="AIzaSyBuDih9ioyQAR9ikg3zEoE_5mhXvZh5oAw"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
...@@ -33,7 +35,17 @@ ...@@ -33,7 +35,17 @@
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> </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. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data
......
...@@ -7,105 +7,107 @@ class AddLocation extends StatefulWidget { ...@@ -7,105 +7,107 @@ class AddLocation extends StatefulWidget {
} }
class AddLocationState extends State<AddLocation> { class AddLocationState extends State<AddLocation> {
String userName;
String phoneNumber;
String riskLocation;
String hotelName;
String date;
String time;
getUserName(name) {
this.userName = name;
}
String userName; getPhoneNumber(pno) {
String phoneNumber; this.phoneNumber = pno;
String riskLocation; }
String hotelName;
String date;
String time;
getUserName(name){
this.userName= name;
}
getPhoneNumber(pno){ getRiskLocation(location) {
this.phoneNumber= pno; this.riskLocation = location;
} }
getRiskLocation(location){ getHotelName(hotelname) {
this.riskLocation= location; this.hotelName = hotelname;
} }
getHotelName(hotelname){ getDate(date) {
this.hotelName= hotelname; this.date = date;
} }
getDate(date){ getTime(time) {
this.date= date; this.time = time;
} }
getTime(time){
this.time= time;
}
//---------------------------------------------Create Data----------------------------------------------------- //---------------------------------------------Create Data-----------------------------------------------------
createData(){ createData() {
print("object"); print("object");
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName); DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
Map<String, dynamic> locations ={
"userName": userName, Map<String, dynamic> locations = {
"phoneNumber": phoneNumber, "userName": userName,
"riskLocation": riskLocation, "phoneNumber": phoneNumber,
"hotelName": hotelName, "riskLocation": riskLocation,
"date": date, "hotelName": hotelName,
"time": time "date": date,
}; "time": time
};
documentReference.setData(locations).whenComplete(() {
print("$userName created"); documentReference.setData(locations).whenComplete(() {
}); print("$userName created");
});
} }
//---------------------------------------------Read Data----------------------------------------------------- //---------------------------------------------Read Data-----------------------------------------------------
readData() {
DocumentReference documentReference =
Firestore.instance.collection("RiskLocation").document(userName);
readData(){ documentReference.get().then((datasnapshot) {
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName);
documentReference.get().then((datasnapshot){
print(datasnapshot.data()["userName"]); print(datasnapshot.data()["userName"]);
print(datasnapshot.data()["phoneNumber"]); print(datasnapshot.data()["phoneNumber"]);
print(datasnapshot.data()["riskLocation"]); print(datasnapshot.data()["riskLocation"]);
print(datasnapshot.data()["hotelName"]); print(datasnapshot.data()["hotelName"]);
print(datasnapshot.data()["date"]); print(datasnapshot.data()["date"]);
print(datasnapshot.data()["time"]); print(datasnapshot.data()["time"]);
}); });
} }
//---------------------------------------------Update Data----------------------------------------------------- //---------------------------------------------Update Data-----------------------------------------------------
updateData(){ updateData() {
print("object"); 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, "userName": userName,
"phoneNumber": phoneNumber, "phoneNumber": phoneNumber,
"riskLocation": riskLocation, "riskLocation": riskLocation,
"hotelName": hotelName, "hotelName": hotelName,
"date": date, "date": date,
"time": time "time": time
}; };
documentReference.setData(locations).whenComplete(() { documentReference.setData(locations).whenComplete(() {
print("$userName Updated"); print("$userName Updated");
}); });
} }
//---------------------------------------------Delete Data----------------------------------------------------- //---------------------------------------------Delete Data-----------------------------------------------------
deleteData(){ deleteData() {
DocumentReference documentReference = Firestore.instance.collection("RiskLocation").document(userName); DocumentReference documentReference =
documentReference.delete().whenComplete((){ Firestore.instance.collection("RiskLocation").document(userName);
print("$userName Deleted"); documentReference.delete().whenComplete(() {
}); print("$userName Deleted");
} });
}
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
//---------------------------------------------User Name----------------------------------------------------- //---------------------------------------------User Name-----------------------------------------------------
Widget _buildName(){ Widget _buildName(){
return TextFormField( return TextFormField(
...@@ -300,7 +302,7 @@ Widget _buildTime(){ ...@@ -300,7 +302,7 @@ Widget _buildTime(){
title: Text("Add Risk Location"), title: Text("Add Risk Location"),
), ),
body: Container( body: Container(
margin: EdgeInsets.all(24), margin: EdgeInsets.all(24),
child: Form( child: Form(
key: _formKey, key: _formKey,
child: ListView( child: ListView(
......
This diff is collapsed.
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),
),
),
),
),
],
),
);
}
}
...@@ -73,14 +73,84 @@ class _homepageState extends State<homepage> { ...@@ -73,14 +73,84 @@ class _homepageState extends State<homepage> {
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]); [DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold( return Scaffold(
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,
......
...@@ -27,81 +27,86 @@ class _resultpageState extends State<resultpage> { ...@@ -27,81 +27,86 @@ class _resultpageState extends State<resultpage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
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: 2,
flex: 7, child: Row(
child: Material( mainAxisAlignment: MainAxisAlignment.center,
elevation: 10.0, children: <Widget>[],
child: Container( ),
width: 300.0, ),
height: 300.0, Expanded(
child: Column( flex: 3,
children: <Widget>[ child: Row(
Material( mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[
width: 300.0, RaisedButton(
height: 300.0, color: Colors.white,
child: ClipRRect( onPressed: () {},
child: Image( child: ClipRRect(
image: child: Image(
AssetImage("lib/assets/images/gameover.jpg"), image: AssetImage(
), "lib/assets/images/gameover.gif",
),
), ),
), ),
Padding( ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.0, vertical: 10.0,
horizontal: 15.0, horizontal: 25.0,
), ),
child: Center( )
child: Text( ],
"You Scored $marks marks", ),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
))
],
)),
), ),
), Padding(
Expanded( padding: EdgeInsets.symmetric(
flex: 4, vertical: 5.0,
child: Row( horizontal: 15.0,
mainAxisAlignment: MainAxisAlignment.center, ),
children: <Widget>[ child: Center(
OutlineButton(
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text( child: Text(
"Continue", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
fontWeight: FontWeight.w900,
), ),
), ),
padding: EdgeInsets.symmetric( )),
vertical: 10.0, Expanded(
horizontal: 25.0, flex: 4,
), child: Row(
borderSide: BorderSide(width: 3.0, color: Colors.indigo), mainAxisAlignment: MainAxisAlignment.center,
splashColor: Colors.indigoAccent, children: <Widget>[
) RaisedButton(
], color: Colors.blueAccent,
), shape: RoundedRectangleBorder(
) borderRadius: BorderRadius.circular(20.0)),
], onPressed: () {
), Navigator.of(context).pushReplacement(MaterialPageRoute(
); builder: (context) => levelsDashboard(),
));
},
child: Text(
"Continue",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
} }
} }
...@@ -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> {
...@@ -73,14 +74,84 @@ class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> { ...@@ -73,14 +74,84 @@ class _maskWearingQuizStartPageState extends State<maskWearingQuizStartPage> {
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]); [DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold( return Scaffold(
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,
),
)
],
),
)
],
));
} }
} }
...@@ -27,81 +27,86 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> { ...@@ -27,81 +27,86 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
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: 2,
flex: 7, child: Row(
child: Material( mainAxisAlignment: MainAxisAlignment.center,
elevation: 10.0, children: <Widget>[],
child: Container( ),
width: 300.0, ),
height: 300.0, Expanded(
child: Column( flex: 3,
children: <Widget>[ child: Row(
Material( mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[
width: 300.0, RaisedButton(
height: 300.0, color: Colors.white,
child: ClipRRect( onPressed: () {},
child: Image( child: ClipRRect(
image: child: Image(
AssetImage("lib/assets/images/gameover.jpg"), image: AssetImage(
), "lib/assets/images/gameover.gif",
),
), ),
), ),
Padding( ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.0, vertical: 10.0,
horizontal: 15.0, horizontal: 25.0,
), ),
child: Center( )
child: Text( ],
"You Scored $marks marks", ),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
)),
],
)),
), ),
), Padding(
Expanded( padding: EdgeInsets.symmetric(
flex: 4, vertical: 5.0,
child: Row( horizontal: 15.0,
mainAxisAlignment: MainAxisAlignment.center, ),
children: <Widget>[ child: Center(
OutlineButton(
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text( child: Text(
"Continue", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
fontWeight: FontWeight.w900,
), ),
), ),
padding: EdgeInsets.symmetric( )),
vertical: 10.0, Expanded(
horizontal: 25.0, flex: 4,
), child: Row(
borderSide: BorderSide(width: 3.0, color: Colors.indigo), mainAxisAlignment: MainAxisAlignment.center,
splashColor: Colors.indigoAccent, children: <Widget>[
) RaisedButton(
], color: Colors.blueAccent,
), shape: RoundedRectangleBorder(
) borderRadius: BorderRadius.circular(20.0)),
], onPressed: () {
), Navigator.of(context).pushReplacement(MaterialPageRoute(
); builder: (context) => levelsDashboard(),
));
},
child: Text(
"Continue",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
} }
} }
...@@ -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> {
...@@ -73,14 +74,84 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> { ...@@ -73,14 +74,84 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]); [DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold( return Scaffold(
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> {
...@@ -27,81 +27,86 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> { ...@@ -27,81 +27,86 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
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: 2,
flex: 7, child: Row(
child: Material( mainAxisAlignment: MainAxisAlignment.center,
elevation: 10.0, children: <Widget>[],
child: Container( ),
width: 300.0, ),
height: 300.0, Expanded(
child: Column( flex: 3,
children: <Widget>[ child: Row(
Material( mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[
width: 300.0, RaisedButton(
height: 300.0, color: Colors.white,
child: ClipRRect( onPressed: () {},
child: Image( child: ClipRRect(
image: child: Image(
AssetImage("lib/assets/images/gameover.jpg"), image: AssetImage(
), "lib/assets/images/gameover.gif",
),
), ),
), ),
Padding( ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.0, vertical: 10.0,
horizontal: 15.0, horizontal: 25.0,
), ),
child: Center( )
child: Text( ],
"You Scored $marks marks", ),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
)),
],
)),
), ),
), Padding(
Expanded( padding: EdgeInsets.symmetric(
flex: 4, vertical: 5.0,
child: Row( horizontal: 15.0,
mainAxisAlignment: MainAxisAlignment.center, ),
children: <Widget>[ child: Center(
OutlineButton(
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text( child: Text(
"Continue", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
fontWeight: FontWeight.w900,
), ),
), ),
padding: EdgeInsets.symmetric( )),
vertical: 10.0, Expanded(
horizontal: 25.0, flex: 4,
), child: Row(
borderSide: BorderSide(width: 3.0, color: Colors.indigo), mainAxisAlignment: MainAxisAlignment.center,
splashColor: Colors.indigoAccent, children: <Widget>[
) RaisedButton(
], color: Colors.blueAccent,
), shape: RoundedRectangleBorder(
) borderRadius: BorderRadius.circular(20.0)),
], onPressed: () {
), Navigator.of(context).pushReplacement(MaterialPageRoute(
); builder: (context) => levelsDashboard(),
));
},
child: Text(
"Continue",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
} }
} }
...@@ -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",
]; ];
...@@ -73,14 +75,84 @@ class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPag ...@@ -73,14 +75,84 @@ class _socialDistanceQuizStartPageState extends State<socialDistanceQuizStartPag
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]); [DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold( return Scaffold(
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> {
...@@ -27,81 +27,86 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> { ...@@ -27,81 +27,86 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
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: 2,
flex: 7, child: Row(
child: Material( mainAxisAlignment: MainAxisAlignment.center,
elevation: 10.0, children: <Widget>[],
child: Container( ),
width: 300.0, ),
height: 300.0, Expanded(
child: Column( flex: 3,
children: <Widget>[ child: Row(
Material( mainAxisAlignment: MainAxisAlignment.center,
child: Container( children: <Widget>[
width: 300.0, RaisedButton(
height: 300.0, color: Colors.white,
child: ClipRRect( onPressed: () {},
child: Image( child: ClipRRect(
image: child: Image(
AssetImage("lib/assets/images/gameover.jpg"), image: AssetImage(
), "lib/assets/images/gameover.gif",
),
), ),
), ),
Padding( ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.0, vertical: 10.0,
horizontal: 15.0, horizontal: 25.0,
), ),
child: Center( )
child: Text( ],
"You Scored $marks marks", ),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
)),
],
)),
), ),
), Padding(
Expanded( padding: EdgeInsets.symmetric(
flex: 4, vertical: 5.0,
child: Row( horizontal: 15.0,
mainAxisAlignment: MainAxisAlignment.center, ),
children: <Widget>[ child: Center(
OutlineButton(
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text( child: Text(
"Continue", "You Scored $marks marks",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 30.0,
fontWeight: FontWeight.w900,
), ),
), ),
padding: EdgeInsets.symmetric( )),
vertical: 10.0, Expanded(
horizontal: 25.0, flex: 4,
), child: Row(
borderSide: BorderSide(width: 3.0, color: Colors.indigo), mainAxisAlignment: MainAxisAlignment.center,
splashColor: Colors.indigoAccent, children: <Widget>[
) RaisedButton(
], color: Colors.blueAccent,
), shape: RoundedRectangleBorder(
) borderRadius: BorderRadius.circular(20.0)),
], onPressed: () {
), Navigator.of(context).pushReplacement(MaterialPageRoute(
); builder: (context) => levelsDashboard(),
));
},
child: Text(
"Continue",
style: TextStyle(
fontSize: 30.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
),
)
],
),
)
],
));
} }
} }
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,
), ),
), ),
......
...@@ -74,14 +74,84 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> { ...@@ -74,14 +74,84 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> {
SystemChrome.setPreferredOrientations( SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]); [DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold( return Scaffold(
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,
),
)
],
),
)
],
));
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -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 = '';
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.
// Message model
import 'package:flutter/cupertino.dart';
@immutable
class Message{
final String title;
final String body;
const Message({
@required this.title,
@required this.body,
});
}
\ No newline at end of file
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