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,
),
)
],
......
This diff is collapsed.
......@@ -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