Commit 1b684247 authored by GayaniPKarunaratne's avatar GayaniPKarunaratne

modificaiton

parents 58a9fa44 769041dc
import 'package:flutter/material.dart';
class AddLocation extends StatefulWidget {
@override
AddLocationState createState() => AddLocationState();
}
class AddLocationState extends State<AddLocation> {
@override
Widget build(BuildContext context) {
return Container(
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'AddLocation.dart';
class EAnalyzerDash extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
systemOverlayStyle: SystemUiOverlayStyle(statusBarColor: Colors.blue.shade900),
title: Text("EAnalyzer DashBoard"),
),
body: Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
image: AssetImage('lib/assets/images/green.jpg'),
))),
SafeArea(
child: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: <Widget>[
Container(
height: 64,
margin: EdgeInsets.only(bottom: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
radius: 32,
backgroundColor: Colors.transparent,
backgroundImage: AssetImage('lib/assets/images/eana.png'),
),
SizedBox(
width: 16,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('EAnalyzer', style: TextStyle(fontSize: 35.0, color: Colors.white)),
],
)
],
),
),
Expanded(
child: GridView.count(
mainAxisSpacing: 10,
crossAxisSpacing: 10,
primary: false,
crossAxisCount: 2,
children: <Widget>[
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => AddLocation()),
);
},
child: Image.asset('lib/assets/images/add80.png'),
),
Text('Add', style: TextStyle(fontSize: 20.0)),
],
)
),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => EAnalyzerDash()),
);
},
child: Image.asset('lib/assets/images/feedback80.png'),
),
Text('FeedBack', style: TextStyle(fontSize: 20.0))
],
)
),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => EAnalyzerDash()),
);
},
child: Image.asset('lib/assets/images/list80.png'),
),
Text('Risk Event List', style: TextStyle(fontSize: 20.0))
],
)
),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => EAnalyzerDash()),
);
},
child: Image.asset('lib/assets/images/search80.png'),
),
Text('Search an Event', style: TextStyle(fontSize: 20.0))
],
)
),
],
),
)
],
),
),
)
],
),
);
}
}
\ No newline at end of file
import 'package:covidefender/STracker/quizpage.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class homepage extends StatefulWidget {
@override
_homepageState createState() => _homepageState();
}
class _homepageState extends State<homepage> {
List<String> images = [
"lib/assets/images/startQuiz.png",
];
Widget customcard(String type, String image) {
return Padding(
padding: EdgeInsets.all(
20.0,
),
child: InkWell(
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => getjson(),
));
},
child: Material(
color: Colors.indigoAccent,
elevation: 10.0,
borderRadius: BorderRadius.circular(20.0),
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
),
child: Material(
elevation: 5.0,
borderRadius: BorderRadius.circular(100.0),
child: Container(
height: 100.0,
width: 100.0,
child: ClipOval(
child: Image(
fit: BoxFit.contain,
image: AssetImage(
image,
),
),
),
),
),
),
Center(
child: Text(
type,
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w700,
),
),
),
],
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return Scaffold(
appBar: AppBar(
title: Text("STracker"),
),
body: ListView(
children: <Widget>[
customcard("Start Quiz", images[0]),
],
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'home.dart';
class levelsDashboard extends StatefulWidget {
@override
_levelsDashboardState createState() => _levelsDashboardState();
}
class _levelsDashboardState extends State<levelsDashboard> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
systemOverlayStyle:
SystemUiOverlayStyle(statusBarColor: Colors.blue.shade900),
title: Text("Levels DashBoard"),
),
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: 64,
margin: EdgeInsets.only(bottom: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
radius: 32,
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: 35.0, color: Colors.white)),
],
)
],
),
),
Expanded(
child: GridView.count(
mainAxisSpacing: 10,
crossAxisSpacing: 10,
primary: false,
crossAxisCount: 2,
children: <Widget>[
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => homepage()),
);
},
child: Image.asset(
'lib/assets/images/handWashing.png'),
),
Text('Hand Washing',
style: TextStyle(fontSize: 20.0)),
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/maskWearing.png'),
),
Text('Mask Wearing',
style: TextStyle(fontSize: 20.0))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/socialDistance.png'),
),
Text('Socila Distance',
style: TextStyle(fontSize: 20.0))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/publicPlaces.png'),
),
Text('Public Places',
style: TextStyle(fontSize: 20.0))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/symptoms.png'),
),
Text('Symptoms',
style: TextStyle(fontSize: 20.0))
],
)),
],
),
)
],
),
),
)
],
),
);
}
}
import 'dart:async';
import 'dart:convert';
import 'package:covidefender/STracker/resultpage.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class getjson extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FutureBuilder(
future:
DefaultAssetBundle.of(context).loadString("lib/assets/python.json"),
builder: (context, snapshot) {
List mydata = json.decode(snapshot.data.toString());
if (mydata == null) {
return Scaffold(
body: Center(
child: Text(
"Loading",
),
),
);
// return quizpage();
} else {
return quizpage(mydata: mydata);
}
});
}
}
class quizpage extends StatefulWidget {
var mydata;
quizpage({Key key, @required this.mydata}) : super(key: key);
@override
_quizpageState createState() => _quizpageState(mydata);
}
class _quizpageState extends State<quizpage> {
var mydata;
_quizpageState(this.mydata);
Color colortoshow = Colors.indigoAccent;
Color right = Colors.green;
Color wrong = Colors.red;
int marks = 0;
int i = 1;
int timer = 30;
String showtimer = "30";
Map<String, Color> btncolor = {
"a": Colors.indigoAccent,
"b": Colors.indigoAccent,
"c": Colors.indigoAccent,
"d": Colors.indigoAccent
};
bool canceltimer = false;
@override
void initState() {
starttimer();
super.initState();
}
void starttimer() async {
const onesec = Duration(seconds: 1);
Timer.periodic(onesec, (Timer t) {
setState(() {
if (timer < 1) {
t.cancel();
nextquestion();
} else if (canceltimer == true) {
t.cancel();
} else {
timer = timer - 1;
}
showtimer = timer.toString();
});
});
}
void nextquestion() {
canceltimer = false;
timer = 30;
setState(() {
if (i < 5) {
i++;
} else {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => resultpage(marks: marks),
));
}
btncolor["a"] = Colors.indigoAccent;
btncolor["b"] = Colors.indigoAccent;
btncolor["c"] = Colors.indigoAccent;
btncolor["d"] = Colors.indigoAccent;
});
starttimer();
}
void checkanswer(String k) {
if (mydata[2]["1"] == mydata[1]["1"][k]) {
marks = marks + 5;
colortoshow = right;
} else {
debugPrint("Test 1");
colortoshow = wrong;
}
setState(() {
btncolor[k] = colortoshow;
canceltimer = true;
});
Timer(Duration(seconds: 2), nextquestion);
}
Widget choicebutton(String k) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 20.0,
),
child: MaterialButton(
onPressed: () => checkanswer(k),
child: Text(
mydata[1][i.toString()][k],
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
),
maxLines: 1,
),
color: btncolor[k],
splashColor: Colors.indigo[700],
highlightColor: Colors.indigo[700],
minWidth: 200.0,
height: 45.0,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
),
);
}
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitDown, DeviceOrientation.portraitUp]);
return WillPopScope(
onWillPop: () {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(
"QuizStar - Warning",
),
content: Text("You can't go back at this stage"),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
'OK',
),
)
],
));
},
child: Scaffold(
body: Column(
children: <Widget>[
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.all(15.0),
alignment: Alignment.bottomLeft,
child: Text(
mydata[0][i.toString()],
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w700,
),
),
decoration: BoxDecoration(
color: Colors.blueAccent,
),
),
),
Expanded(
flex: 6,
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
choicebutton('a'),
choicebutton('b'),
choicebutton('c'),
choicebutton('d'),
],
),
),
),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.topCenter,
child: Center(
child: Text(
showtimer,
style: TextStyle(
fontSize: 35.0,
fontWeight: FontWeight.w700,
),
),
),
decoration: BoxDecoration(
color: Colors.red,
),
),
),
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'levelsDashboard.dart';
class resultpage extends StatefulWidget {
int marks;
resultpage({Key key, @required this.marks}) : super(key: key);
@override
_resultpageState createState() => _resultpageState(marks);
}
class _resultpageState extends State<resultpage> {
int marks;
_resultpageState(this.marks);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
"Result",
),
),
body: Column(
children: <Widget>[
Expanded(
flex: 7,
child: Material(
elevation: 10.0,
child: Container(
width: 300.0,
height: 300.0,
child: Column(
children: <Widget>[
Material(
child: Container(
width: 300.0,
height: 300.0,
child: ClipRRect(
child: Image(
image:
AssetImage("lib/assets/images/gameover.jpg"),
),
),
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 5.0,
horizontal: 15.0,
),
child: Center(
child: Text(
"You Scored $marks marks",
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w700,
),
),
))
],
)),
),
),
Expanded(
flex: 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlineButton(
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => levelsDashboard(),
));
},
child: Text(
"Continue",
style: TextStyle(
fontSize: 18.0,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 25.0,
),
borderSide: BorderSide(width: 3.0, color: Colors.indigo),
splashColor: Colors.indigoAccent,
)
],
),
)
],
),
);
}
}
import 'dart:async';
import 'package:covidefender/STracker/strackerDashboard.dart';
import 'package:flutter/material.dart';
class splashscreen extends StatefulWidget {
@override
_splashscreenState createState() => _splashscreenState();
}
class _splashscreenState extends State<splashscreen> {
@override
void initState() {
super.initState();
Timer(Duration(seconds: 3), () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => strackerDasboard(),
));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.indigo,
body: Center(
child: Text(
"QuizStar",
style: TextStyle(
fontSize: 50.0,
color: Colors.white,
),
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'levelsDashboard.dart';
class strackerDasboard extends StatefulWidget {
@override
_strackerDasboardState createState() => _strackerDasboardState();
}
class _strackerDasboardState extends State<strackerDasboard> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
systemOverlayStyle:
SystemUiOverlayStyle(statusBarColor: Colors.blue.shade900),
title: Text("STracker DashBoard"),
),
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: 64,
margin: EdgeInsets.only(bottom: 20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CircleAvatar(
radius: 32,
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: 35.0, color: Colors.white)),
],
)
],
),
),
Expanded(
child: GridView.count(
mainAxisSpacing: 10,
crossAxisSpacing: 10,
primary: false,
crossAxisCount: 2,
children: <Widget>[
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => levelsDashboard()),
);
},
child:
Image.asset('lib/assets/images/play.png'),
),
Text('Play', style: TextStyle(fontSize: 20.0)),
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/instructions.png'),
),
Text('Instructions',
style: TextStyle(fontSize: 20.0))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/score.png'),
),
Text('Score Board',
style: TextStyle(fontSize: 20.0))
],
)),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => EAnalyzerDash()),
// );
// },
child: Image.asset(
'lib/assets/images/awrenessLevel.png'),
),
Text('Awreness Level',
style: TextStyle(fontSize: 20.0))
],
)),
],
),
)
],
),
),
)
],
),
);
}
}
[
{
"1": "Question 1: Test 123 123 123 123 123 132 123",
"2": "Question 2: Test 123 123 123 123 123 132 123",
"3": "Question 3: Test 123 123 123 123 123 132 123",
"4": "Question 4: Test 123 123 123 123 123 132 123",
"5": "Question 5: Test 123 123 123 123 123 132 123",
"6": "Question 6: Test 123 123 123 123 123 132 123",
"7": "Question 7: Test 123 123 123 123 123 132 123",
"8": "Question 8: Test 123 123 123 123 123 132 123",
"9": "Question 9: Test 123 123 123 123 123 132 123",
"10": "Question 10: Test 123 123 123 123 123 132 123"
},
{
"1": {
"a": "pp",
"b": "ppp",
"c": "3p",
"d": "p3"
},
"2": {
"a": "typedef",
"b": "typeof",
"c": "type",
"d": "find"
},
"3": {
"a": "func",
"b": "def",
"c": "void",
"d": "function"
},
"4": {
"a": "count",
"b": "print",
"c": "println",
"d": "stderr"
},
"5": {
"a": "typedef",
"b": "typeof",
"c": "type",
"d": "find"
},
"6": {
"a": "func",
"b": "dev",
"c": "void",
"d": "function"
},
"7": {
"a": "typedev",
"b": "typeof",
"c": "type",
"d": "find"
},
"8": {
"a": "func",
"b": "dev",
"c": "void",
"d": "function"
},
"9": {
"a": "typedev",
"b": "typeof",
"c": "type",
"d": "find"
},
"10": {
"a": "func",
"b": "dev",
"c": "void",
"d": "function"
}
},
{
"1": "ppp",
"2": "type",
"3": "def",
"4": "print",
"5": "type",
"6": "def",
"7": "type",
"8": "def",
"9": "type",
"10": "def"
}
]
\ No newline at end of file
This diff is collapsed.
......@@ -48,8 +48,35 @@ flutter:
assets:
- lib/assets/images/top_header.jpg
- lib/assets/images/mino.jpg
- lib/assets/images/boralu.jpg
- lib/assets/images/green.jpg
- lib/assets/images/map80.png
- lib/assets/images/man80.png
- lib/assets/images/bar80.png
- lib/assets/images/coach80.png
- lib/assets/images/time80.png
- lib/assets/images/event80.png
- lib/assets/images/eana.png
- lib/assets/images/add80.png
- lib/assets/images/feedback80.png
- lib/assets/images/list80.png
- lib/assets/images/search80.png
- lib/assets/
- lib/assets/images/awrenessLevel.png
- lib/assets/images/exit.png
- lib/assets/images/instructions.png
- lib/assets/images/play.png
- lib/assets/images/score.png
- lib/assets/images/gameover.jpg
- lib/assets/images/stracker.PNG
- lib/assets/images/topHeaderStracker.png
- lib/assets/images/handWashing.png
- lib/assets/images/maskWearing.png
- lib/assets/images/publicPlaces.png
- lib/assets/images/socialDistance.png
- lib/assets/images/symptoms.png
- lib/assets/images/startQuiz.png
# To add assets to your application, add an assets section, like this:
# assets:
......
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