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

Responsiveness in STracker

parent 7aaf5cbc
......@@ -73,7 +73,7 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w900,
),
),
......@@ -99,8 +99,8 @@ class _maskWearingResultPageState extends State<maskWearingResultPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -5,7 +5,6 @@ import 'package:covidefender/STracker/PublicPlaces/publicPlacesResultPage.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class getjsonPublicPlaces extends StatelessWidget {
@override
Widget build(BuildContext context) {
......@@ -37,7 +36,8 @@ class quizpagePublicPlaces extends StatefulWidget {
quizpagePublicPlaces({Key key, @required this.mydata}) : super(key: key);
@override
_quizpagePublicPlacesState createState() => _quizpagePublicPlacesState(mydata);
_quizpagePublicPlacesState createState() =>
_quizpagePublicPlacesState(mydata);
}
class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
......@@ -145,7 +145,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 20.0,
vertical: 10.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -154,15 +154,15 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontSize: 15.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 500.0,
height: 70.0,
minWidth: 300.0,
height: 40.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -202,14 +202,14 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
child: Material(
elevation: 20.0,
child: Container(
width: 400.0,
width: 300.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 400.0,
height: 375.0,
width: 200.0,
height: 200.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -222,15 +222,18 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
)),
),
),
SizedBox(
height: 10,
),
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
padding: EdgeInsets.all(0.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 30.0,
fontSize: 15.0,
fontWeight: FontWeight.w700,
),
),
......@@ -261,7 +264,7 @@ class _quizpagePublicPlacesState extends State<quizpagePublicPlaces> {
child: Text(
showtimer,
style: TextStyle(
fontSize: 35.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -80,7 +80,7 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
body: Column(
children: <Widget>[
Expanded(
flex: 1,
flex: 2,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
......@@ -144,8 +144,8 @@ class _publicPlacesQuizStartPageState extends State<publicPlacesQuizStartPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -73,7 +73,7 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w900,
),
),
......@@ -99,8 +99,8 @@ class _publicPlacesResultPageState extends State<publicPlacesResultPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -145,7 +145,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 20.0,
vertical: 10.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -154,15 +154,15 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontSize: 15.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 500.0,
height: 70.0,
minWidth: 300.0,
height: 40.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -202,14 +202,14 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
child: Material(
elevation: 20.0,
child: Container(
width: 400.0,
width: 300.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 400.0,
height: 375.0,
width: 200.0,
height: 200.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -222,15 +222,18 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
)),
),
),
SizedBox(
height: 10,
),
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
padding: EdgeInsets.all(0.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 30.0,
fontSize: 15.0,
fontWeight: FontWeight.w700,
),
),
......@@ -261,7 +264,7 @@ class _quizpageSocialDistanceState extends State<quizpageSocialDistance> {
child: Text(
showtimer,
style: TextStyle(
fontSize: 35.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -145,8 +145,8 @@ class _socialDistanceQuizStartPageState
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -73,7 +73,7 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w900,
),
),
......@@ -99,8 +99,8 @@ class _socialDistanceResultPageState extends State<socialDistanceResultPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -144,7 +144,7 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 20.0,
vertical: 10.0,
horizontal: 20.0,
),
child: MaterialButton(
......@@ -153,15 +153,15 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontSize: 15.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 500.0,
height: 70.0,
minWidth: 300.0,
height: 40.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
......@@ -201,14 +201,14 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
child: Material(
elevation: 20.0,
child: Container(
width: 400.0,
width: 300.0,
height: 50.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 400.0,
height: 375.0,
width: 200.0,
height: 200.0,
child: ClipRRect(
child: Image(
image: AssetImage(
......@@ -221,15 +221,18 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
)),
),
),
SizedBox(
height: 10,
),
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.all(15.0),
padding: EdgeInsets.all(0.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 20.0,
fontSize: 15.0,
fontWeight: FontWeight.w700,
),
),
......@@ -260,7 +263,7 @@ class _quizpageSymptomsState extends State<quizpageSymptoms> {
child: Text(
showtimer,
style: TextStyle(
fontSize: 35.0,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
),
......
......@@ -144,8 +144,8 @@ class _symptomsQuizStartPageState extends State<symptomsQuizStartPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -72,7 +72,7 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w900,
),
),
......@@ -98,8 +98,8 @@ class _symptomsResultPageState extends State<symptomsResultPage> {
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
import 'package:flutter/material.dart';
import 'dart:convert';
import 'finalOverallResultsPage.dart';
import 'levelsDashboard.dart';
import 'variables.dart';
import 'package:http/http.dart' as http;
class fResult extends StatefulWidget {
int marks;
fResult() : super();
@override
_fResultState createState() => _fResultState();
}
class _fResultState extends State<fResult> {
int marks;
int ima1 = 0;
int ima2 = 0;
int ima3 = 0;
int ima4 = 0;
int ima5 = 0;
String handWashingLevel = '';
String maskWearingLevel = '';
String socialDistanceLevel = '';
String publicPlacesLevel = '';
String symptomsLevel = '';
String handWashingLevelData = '';
String maskWearingLevelData = '';
String socialDistanceLevelData = '';
String publicPlacesLevelData = '';
String symptomsLevelData = '';
_fResultState();
@override
void initState() {
setLevel();
super.initState();
}
void setLevel() {
if ((marks1 >= 0 && (marks1 <= 24))) {
handWashingLevel = 'Very Low';
handWashingLevelData = '0';
ima1 = 100;
} else if ((marks1 >= 25 && (marks1 <= 48))) {
handWashingLevel = 'Low';
handWashingLevelData = '1';
ima1 = 200;
} else if ((marks1 >= 49 && (marks1 <= 72))) {
handWashingLevel = 'Moderate';
handWashingLevelData = '2';
ima1 = 300;
} else if ((marks1 >= 73 && (marks1 <= 96))) {
handWashingLevel = 'High';
handWashingLevelData = '3';
ima1 = 400;
} else if ((marks1 >= 97 && (marks1 <= 120))) {
handWashingLevel = 'Very High';
handWashingLevelData = '4';
ima1 = 500;
}
if ((marks2 >= 0 && (marks2 <= 32))) {
maskWearingLevel = 'Very Low';
maskWearingLevelData = '0';
ima2 = 100;
} else if ((marks2 >= 33 && (marks2 <= 64))) {
maskWearingLevel = 'Low';
maskWearingLevelData = '1';
ima2 = 200;
} else if ((marks2 >= 65 && (marks2 <= 96))) {
maskWearingLevel = 'Moderate';
maskWearingLevelData = '2';
ima2 = 300;
} else if ((marks2 >= 97 && (marks2 <= 128))) {
maskWearingLevel = 'High';
maskWearingLevelData = '3';
ima2 = 400;
} else if ((marks2 >= 129 && (marks2 <= 160))) {
maskWearingLevel = 'Very High';
maskWearingLevelData = '4';
ima2 = 500;
}
if ((marks3 >= 0 && (marks3 <= 32))) {
socialDistanceLevel = 'Very Low';
socialDistanceLevelData = '0';
ima3 = 100;
} else if ((marks3 >= 33 && (marks3 <= 64))) {
socialDistanceLevel = 'Low';
socialDistanceLevelData = '1';
ima3 = 200;
} else if ((marks3 >= 65 && (marks3 <= 96))) {
socialDistanceLevel = 'Moderate';
socialDistanceLevelData = '2';
ima3 = 300;
} else if ((marks3 >= 97 && (marks3 <= 128))) {
socialDistanceLevel = 'High';
socialDistanceLevelData = '3';
ima3 = 400;
} else if ((marks3 >= 129 && (marks3 <= 160))) {
socialDistanceLevel = 'Very High';
socialDistanceLevelData = '4';
ima3 = 500;
}
if ((marks4 >= 0 && (marks4 <= 16))) {
publicPlacesLevel = 'Very Low';
publicPlacesLevelData = '0';
ima4 = 100;
} else if ((marks4 >= 17 && (marks4 <= 32))) {
publicPlacesLevel = 'Low';
publicPlacesLevelData = '1';
ima4 = 200;
} else if ((marks4 >= 33 && (marks4 <= 48))) {
publicPlacesLevel = 'Moderate';
publicPlacesLevelData = '2';
ima4 = 300;
} else if ((marks4 >= 49 && (marks4 <= 64))) {
publicPlacesLevel = 'High';
publicPlacesLevelData = '3';
ima4 = 400;
} else if ((marks4 >= 65 && (marks4 <= 80))) {
publicPlacesLevel = 'Very High';
publicPlacesLevelData = '4';
ima4 = 500;
}
if ((marks5 >= 0 && (marks5 <= 8))) {
symptomsLevel = 'Very Low';
symptomsLevelData = '0';
ima5 = 100;
} else if ((marks5 >= 9 && (marks5 <= 16))) {
symptomsLevel = 'Low';
symptomsLevelData = '1';
ima5 = 200;
} else if ((marks5 >= 17 && (marks5 <= 24))) {
symptomsLevel = 'Moderate';
symptomsLevelData = '2';
ima5 = 300;
} else if ((marks5 >= 25 && (marks5 <= 32))) {
symptomsLevel = 'High';
symptomsLevelData = '3';
ima5 = 400;
} else if ((marks5 >= 33 && (marks5 <= 40))) {
symptomsLevel = 'Very High';
symptomsLevelData = '4';
ima5 = 500;
}
}
Future Getdata(url) async {
http.Response Response = await http.get(url);
return Response.body;
}
Future<void> check() async {
String urls =
'https://strackercovid.herokuapp.com/api/stracker?HandWashing=' +
handWashingLevelData.toString() +
'&MaskWearing=' +
maskWearingLevelData.toString() +
'&ScocialDistence=' +
socialDistanceLevelData.toString() +
'&BehaveInPublicPlaces=' +
publicPlacesLevelData.toString() +
'&Symptoms=' +
symptomsLevelData.toString();
var Data = await Getdata(urls);
var reText = jsonDecode(Data);
print(reText);
if (reText.toString() == '[0]') {
print("Very Low");
marks6 = 'Very Low';
} else if (reText.toString() == '[1]') {
print("Low");
marks6 = 'Low';
} else if (reText.toString() == '[2]') {
print("Moderate");
marks6 = 'Moderate';
} else if (reText.toString() == '[3]') {
print("High");
marks6 = 'High';
} else if (reText.toString() == '[4]') {
print("Very High");
marks6 = 'Very High';
}
}
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
title: Text("Final Result"),
),
body: Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
image: AssetImage(
'lib/assets/images/topHeaderStracker.png',
),
))),
SafeArea(
child: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: <Widget>[
Container(
height: 45,
margin: EdgeInsets.only(bottom: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
radius: 20,
backgroundColor: Colors.transparent,
backgroundImage:
AssetImage('lib/assets/images/stracker.PNG'),
),
SizedBox(
width: 16,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('STracker',
style: TextStyle(
fontSize: 30.0, color: Colors.white)),
],
)
],
),
),
Expanded(
flex: 10,
child: GridView.count(
mainAxisSpacing: 10,
crossAxisSpacing: 10,
primary: false,
crossAxisCount: 2,
children: <Widget>[
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 10,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Image.asset(
"lib/assets/images/$ima1.png",
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Hand Washing $marks1 / 120 \n \t \t \t \t \t $handWashingLevel",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700,
)),
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Image.asset(
"lib/assets/images/$ima2.png",
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Mask Wearing - $marks2 / 160 \n \t \t \t \t \t \t \t $maskWearingLevel",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Image.asset(
"lib/assets/images/$ima3.png",
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Distance - $marks3 / 160 \n \t \t \t $socialDistanceLevel",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Image.asset(
"lib/assets/images/$ima4.png",
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Public places - $marks4 / 80 \n \t \t \t \t \t $publicPlacesLevel",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Image.asset(
"lib/assets/images/$ima5.png",
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Symptoms - $marks5 / 40 \n \t \t \t $symptomsLevel",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700,
))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
print("EEEE");
check();
Navigator.of(context)
.pushReplacement(MaterialPageRoute(
builder: (context) =>
finalOverallResultPage(),
));
},
child: Image.asset(
'lib/assets/images/result.png',
fit: BoxFit.contain,
width: 60,
height: 60,
),
),
Text(
"Overall Awareness \n \t \t \t \t \t \t Level",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w700))
],
)),
],
),
)
],
),
),
)
],
),
);
}
}
......@@ -13,8 +13,7 @@ class finalOverallResultPage extends StatefulWidget {
}
class _finalOverallResultPageState extends State<finalOverallResultPage> {
// int ima;
int ima = 100;
_finalOverallResultPageState();
......@@ -27,25 +26,21 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
void setLevel() {
print('marks6');
print(marks6);
if(marks6 == 'Very Low'){
// ima = 100;
if (marks6 == 'Very Low') {
ima = 100;
print('1');
}else if(marks6 == 'Low'){
// ima = 200;
} else if (marks6 == 'Low') {
ima = 200;
print('2');
}else if(marks6 == 'Moderate'){
// ima = 300;
} else if (marks6 == 'Moderate') {
ima = 300;
print('3');
}else if(marks6 == 'High'){
// ima = 400;
} else if (marks6 == 'High') {
ima = 400;
print('4');
}else if(marks6 == 'Very High'){
// ima = 500;
} else if (marks6 == 'Very High') {
ima = 500;
print('5');
}
}
......@@ -116,16 +111,16 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
body: Column(
children: <Widget>[
Expanded(
flex: 1,
flex: 2,
child: ButtonTheme(
minWidth: 800.0,
height: 100.0,
height: 200.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Overall Awareness Level",
style: TextStyle(color: Colors.white, fontSize: 30),
style: TextStyle(color: Colors.white, fontSize: 20),
),
),
)),
......@@ -169,7 +164,7 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
onPressed: () {},
child: Text(
"Your Awareness Level - $marks6",
style: TextStyle(color: Colors.red, fontSize: 30),
style: TextStyle(color: Colors.red, fontSize: 20),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
......@@ -189,7 +184,7 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
onPressed: () {},
child: Image(
image: AssetImage(
"lib/assets/images/100.png",
"lib/assets/images/$ima.png",
),
),
padding: EdgeInsets.symmetric(
......@@ -217,12 +212,12 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
child: Text(
"Registration",
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 20.0,
horizontal: 200.0,
vertical: 10.0,
horizontal: 50.0,
),
)
],
......
......@@ -154,38 +154,43 @@ class _finalResultState extends State<finalResult> {
}
}
Future Getdata(url) async{
Future Getdata(url) async {
http.Response Response = await http.get(url);
return Response.body;
}
}
Future<void> check() async{
String urls = 'https://strackercovid.herokuapp.com/api/stracker?HandWashing='+handWashingLevelData.toString()+'&MaskWearing='+maskWearingLevelData.toString()+'&ScocialDistence='+socialDistanceLevelData.toString()+'&BehaveInPublicPlaces='+publicPlacesLevelData.toString()+'&Symptoms='+symptomsLevelData.toString();
Future<void> check() async {
String urls =
'https://strackercovid.herokuapp.com/api/stracker?HandWashing=' +
handWashingLevelData.toString() +
'&MaskWearing=' +
maskWearingLevelData.toString() +
'&ScocialDistence=' +
socialDistanceLevelData.toString() +
'&BehaveInPublicPlaces=' +
publicPlacesLevelData.toString() +
'&Symptoms=' +
symptomsLevelData.toString();
var Data = await Getdata(urls);
var reText = jsonDecode(Data);
print(reText);
if(reText.toString() == '[0]') {
if (reText.toString() == '[0]') {
print("Very Low");
marks6 = 'Very Low';
}
else if(reText.toString() == '[1]') {
} else if (reText.toString() == '[1]') {
print("Low");
marks6 = 'Low';
}
else if(reText.toString() == '[2]') {
} else if (reText.toString() == '[2]') {
print("Moderate");
marks6 = 'Moderate';
}
else if(reText.toString() == '[3]') {
} else if (reText.toString() == '[3]') {
print("High");
marks6 = 'High';
}
else if(reText.toString() == '[4]') {
} else if (reText.toString() == '[4]') {
print("Very High");
marks6 = 'Very High';
}
}
}
Widget build(BuildContext context) {
return Scaffold(
......
......@@ -2,6 +2,7 @@ import 'package:covidefender/STracker/MaskWearing/maskWearingQuizStartPage.dart'
import 'package:covidefender/STracker/PublicPlaces/publicPlacesQuizStartPage.dart';
import 'package:covidefender/STracker/SocialDistance/socialDistanceQuizStartPage.dart';
import 'package:covidefender/STracker/Symptoms/symptomsQuizStartPage.dart';
import 'package:covidefender/STracker/fResult.dart';
import 'package:covidefender/STracker/finalResult.dart';
import 'package:flutter/material.dart';
......@@ -36,13 +37,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Column(
children: <Widget>[
Container(
height: 64,
height: 45,
margin: EdgeInsets.only(bottom: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
radius: 32,
radius: 20,
backgroundColor: Colors.transparent,
backgroundImage:
AssetImage('lib/assets/images/stracker.PNG'),
......@@ -56,13 +57,14 @@ class _levelsDashboardState extends State<levelsDashboard> {
children: <Widget>[
Text('STracker',
style: TextStyle(
fontSize: 35.0, color: Colors.white)),
fontSize: 30.0, color: Colors.white)),
],
)
],
),
),
Expanded(
flex: 10,
child: GridView.count(
mainAxisSpacing: 10,
crossAxisSpacing: 10,
......@@ -87,13 +89,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Image.asset(
'lib/assets/images/handWashing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Hand Washing',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
)),
],
......@@ -117,13 +119,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Image.asset(
'lib/assets/images/maskWearing.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Mask Wearing',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
))
],
......@@ -147,13 +149,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Image.asset(
'lib/assets/images/socialDistance.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Socila Distance',
Text('Distance',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
))
],
......@@ -177,13 +179,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Image.asset(
'lib/assets/images/publicPlaces.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Public Places',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
))
],
......@@ -207,13 +209,13 @@ class _levelsDashboardState extends State<levelsDashboard> {
child: Image.asset(
'lib/assets/images/symptoms.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Symptoms',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700,
))
],
......@@ -230,19 +232,19 @@ class _levelsDashboardState extends State<levelsDashboard> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => finalResult()),
builder: (context) => fResult()),
);
},
child: Image.asset(
'lib/assets/images/result.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Final Result',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700))
],
)),
......
......@@ -63,7 +63,7 @@ class _strackerDasboardState extends State<strackerDasboard> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
radius: 100,
radius: 50,
backgroundColor: Colors.transparent,
backgroundImage:
AssetImage('lib/assets/images/stracker.PNG'),
......@@ -98,13 +98,13 @@ class _strackerDasboardState extends State<strackerDasboard> {
child: Image.asset(
'lib/assets/images/play.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Play',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700)),
],
)),
......@@ -125,13 +125,13 @@ class _strackerDasboardState extends State<strackerDasboard> {
child: Image.asset(
'lib/assets/images/instructions.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Instructions',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700))
],
)),
......@@ -152,13 +152,13 @@ class _strackerDasboardState extends State<strackerDasboard> {
child: Image.asset(
'lib/assets/images/score.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Score Board',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700))
],
)),
......@@ -179,13 +179,13 @@ class _strackerDasboardState extends State<strackerDasboard> {
child: Image.asset(
'lib/assets/images/awrenessLevel.png',
fit: BoxFit.contain,
width: 200,
height: 200,
width: 100,
height: 100,
),
),
Text('Awreness Level',
Text('Awareness ',
style: TextStyle(
fontSize: 30.0,
fontSize: 20.0,
fontWeight: FontWeight.w700))
],
)),
......
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