Commit 4745d41d authored by Piyumi Dayarathna's avatar Piyumi Dayarathna 💬

Modifications in STracker

parent 690a503e
import 'package:covidefender/STracker/overallImageGif.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:convert'; import 'dart:convert';
import 'finalOverallResultsPage.dart'; import 'finalOverallResultsPage.dart';
...@@ -263,7 +264,8 @@ class _fResultState extends State<fResult> { ...@@ -263,7 +264,8 @@ class _fResultState extends State<fResult> {
), ),
), ),
Text( Text(
"Hand Washing $marks1 / 120 \n \t \t \t \t \t $handWashingLevel", "Hand Washing \n $marks1 / 120 \n $handWashingLevel",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
...@@ -286,7 +288,8 @@ class _fResultState extends State<fResult> { ...@@ -286,7 +288,8 @@ class _fResultState extends State<fResult> {
), ),
), ),
Text( Text(
"Mask Wearing - $marks2 / 160 \n \t \t \t \t \t \t \t $maskWearingLevel", "Mask Wearing \n $marks2 / 160 \n $maskWearingLevel",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
...@@ -309,7 +312,8 @@ class _fResultState extends State<fResult> { ...@@ -309,7 +312,8 @@ class _fResultState extends State<fResult> {
), ),
), ),
Text( Text(
"Distance - $marks3 / 160 \n \t \t \t $socialDistanceLevel", "Social Distance \n $marks3 / 160 \n $socialDistanceLevel",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
...@@ -332,7 +336,8 @@ class _fResultState extends State<fResult> { ...@@ -332,7 +336,8 @@ class _fResultState extends State<fResult> {
), ),
), ),
Text( Text(
"Public places - $marks4 / 80 \n \t \t \t \t \t $publicPlacesLevel", "Public places \n $marks4 / 80 \n $publicPlacesLevel",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
...@@ -355,7 +360,8 @@ class _fResultState extends State<fResult> { ...@@ -355,7 +360,8 @@ class _fResultState extends State<fResult> {
), ),
), ),
Text( Text(
"Symptoms - $marks5 / 40 \n \t \t \t $symptomsLevel", "Symptoms \n $marks5 / 40 \n $symptomsLevel",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
...@@ -371,12 +377,10 @@ class _fResultState extends State<fResult> { ...@@ -371,12 +377,10 @@ class _fResultState extends State<fResult> {
children: <Widget>[ children: <Widget>[
FlatButton( FlatButton(
onPressed: () { onPressed: () {
print("EEEE");
check(); check();
Navigator.of(context) Navigator.of(context)
.pushReplacement(MaterialPageRoute( .pushReplacement(MaterialPageRoute(
builder: (context) => builder: (context) => overallImageGif(),
finalOverallResultPage(),
)); ));
}, },
child: Image.asset( child: Image.asset(
...@@ -386,8 +390,8 @@ class _fResultState extends State<fResult> { ...@@ -386,8 +390,8 @@ class _fResultState extends State<fResult> {
height: 60, height: 60,
), ),
), ),
Text( Text("Overall Awareness \n Level",
"Overall Awareness \n \t \t \t \t \t \t Level", textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
fontWeight: FontWeight.w700)) fontWeight: FontWeight.w700))
......
...@@ -119,52 +119,25 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> { ...@@ -119,52 +119,25 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
color: Colors.redAccent, color: Colors.redAccent,
onPressed: () {}, onPressed: () {},
child: Text( child: Text(
"Overall Awareness Level", "Your Overall Awareness Level",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 20), style: TextStyle(color: Colors.white, fontSize: 20),
), ),
), ),
)), )),
Expanded(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 8,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/awarenessLevel.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Expanded( Expanded(
flex: 2, flex: 2,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
RaisedButton( RaisedButton(
color: Colors.white, color: Colors.blue,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {}, onPressed: () {},
child: Text( child: Text(
"Your Awareness Level - $marks6", "$marks6",
style: TextStyle(color: Colors.red, fontSize: 20), style: TextStyle(color: Colors.white, fontSize: 20),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 10.0,
...@@ -181,6 +154,8 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> { ...@@ -181,6 +154,8 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
children: <Widget>[ children: <Widget>[
RaisedButton( RaisedButton(
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
onPressed: () {}, onPressed: () {},
child: Image( child: Image(
image: AssetImage( image: AssetImage(
...@@ -188,15 +163,15 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> { ...@@ -188,15 +163,15 @@ class _finalOverallResultPageState extends State<finalOverallResultPage> {
), ),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10.0, vertical: 20.0,
horizontal: 25.0, horizontal: 30.0,
), ),
) )
], ],
), ),
), ),
Expanded( Expanded(
flex: 4, flex: 3,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
......
import 'package:covidefender/STracker/finalOverallResultsPage.dart';
import 'package:covidefender/STracker/levelsDashboard.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'variables.dart';
class overallImageGif extends StatefulWidget {
String marks;
overallImageGif() : super();
@override
_overallImageGifState createState() => _overallImageGifState();
}
class _overallImageGifState extends State<overallImageGif> {
int ima = 100;
_overallImageGifState();
@override
void initState() {
super.initState();
}
Widget customcard(String type, String image) {
return Padding(
padding: EdgeInsets.all(
20.0,
),
child: InkWell(
onTap: () {
// Navigator.of(context).pushReplacement(MaterialPageRoute(
// builder: (context) => getjson(),
// ));
},
child: Material(
color: Colors.indigoAccent,
elevation: 10.0,
borderRadius: BorderRadius.circular(20.0),
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
),
child: Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(100.0),
child: Container(
height: 100.0,
width: 100.0,
child: ClipOval(
child: Image(
fit: BoxFit.contain,
image: AssetImage(
image,
),
),
),
),
),
),
Center(
child: Text(
type,
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w700,
),
),
),
],
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold(
appBar: AppBar(
title: Text("STracker"),
),
body: Column(
children: <Widget>[
Expanded(
flex: 2,
child: ButtonTheme(
minWidth: 800.0,
height: 200.0,
child: RaisedButton(
color: Colors.redAccent,
onPressed: () {},
child: Text(
"Overall Awareness Level",
style: TextStyle(color: Colors.white, fontSize: 20),
),
),
)),
Expanded(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
Expanded(
flex: 6,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: ClipRRect(
child: Image(
image: AssetImage(
"lib/assets/images/awarenessLevel.gif",
),
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
)
],
),
),
Expanded(
flex: 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) => finalOverallResultPage(),
));
},
child: Text(
"Click Here",
style: TextStyle(
fontSize: 20.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 50.0,
),
)
],
),
)
],
));
}
}
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