Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-035-CoviDefender
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-035
2021-035-CoviDefender
Commits
e3e5cab2
Commit
e3e5cab2
authored
Jul 01, 2021
by
GayaniPKarunaratne
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'EAnalyzer_KarunaratneGP' of
http://gitlab.sliit.lk/2021-035/2021-035-covidefender
parents
3f39a305
ac02a9e1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
18 deletions
+161
-18
lib/EAnalyzer/AddLocation.dart
lib/EAnalyzer/AddLocation.dart
+12
-12
lib/EAnalyzer/EAnalyzerDash.dart
lib/EAnalyzer/EAnalyzerDash.dart
+2
-1
lib/EAnalyzer/HospitalDetails.dart
lib/EAnalyzer/HospitalDetails.dart
+5
-3
lib/EAnalyzer/Loading.dart
lib/EAnalyzer/Loading.dart
+2
-2
lib/EAnalyzer/SearchEvent.dart
lib/EAnalyzer/SearchEvent.dart
+132
-0
pubspec.lock
pubspec.lock
+7
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/EAnalyzer/AddLocation.dart
View file @
e3e5cab2
...
@@ -259,18 +259,18 @@ Widget _buildTime(){
...
@@ -259,18 +259,18 @@ Widget _buildTime(){
}
,
}
,
),
),
RaisedButton
(
//
RaisedButton(
color:
Colors
.
blue
,
//
color: Colors.blue,
child:
Text
(
//
child: Text(
'View'
,
//
'View',
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
18
),
//
style: TextStyle(color: Colors.white, fontSize: 18),
),
//
),
onPressed:
()
{
//
onPressed: () {
readData
();
//
readData();
}
,
//
} ,
),
//
),
RaisedButton
(
RaisedButton
(
color:
Colors
.
yellowAccent
[
700
],
color:
Colors
.
yellowAccent
[
700
],
...
...
lib/EAnalyzer/EAnalyzerDash.dart
View file @
e3e5cab2
import
'package:covidefender/EAnalyzer/HospitalDetails.dart'
;
import
'package:covidefender/EAnalyzer/HospitalDetails.dart'
;
import
'package:covidefender/EAnalyzer/SearchEvent.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'AddLocation.dart'
;
import
'AddLocation.dart'
;
...
@@ -126,7 +127,7 @@ class EAnalyzerDash extends StatelessWidget {
...
@@ -126,7 +127,7 @@ class EAnalyzerDash extends StatelessWidget {
onPressed:
()
{
onPressed:
()
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
EAnalyzerDash
()),
MaterialPageRoute
(
builder:
(
context
)
=>
SearchEvent
()),
);
);
},
},
child:
Image
.
asset
(
'lib/assets/images/search80.png'
),
child:
Image
.
asset
(
'lib/assets/images/search80.png'
),
...
...
lib/EAnalyzer/HospitalDetails.dart
View file @
e3e5cab2
...
@@ -63,13 +63,15 @@ class _HospitalDetailsState extends State<HospitalDetails> {
...
@@ -63,13 +63,15 @@ class _HospitalDetailsState extends State<HospitalDetails> {
itemCount:
userData
==
null
?
0
:
userData
.
length
,
itemCount:
userData
==
null
?
0
:
userData
.
length
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Card
(
return
Card
(
elevation:
8
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
color:
Colors
.
lightGreen
[
50
],
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
12.0
),
padding:
const
EdgeInsets
.
all
(
12.0
),
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
CircleAvatar
(
//backgroundImage: NetworkImage(userData[index]["hospital_id"]) ,
),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
all
(
12.0
),
padding:
const
EdgeInsets
.
all
(
12.0
),
child:
Text
(
"Hospital ID:
${userData[index]["hospital_id"]}
\n
${userData[index]["hospital"]["name"]}
\n
${userData[index]["hospital"]["name_si"]}
\n\n
Total Patients:
${userData[index]["cumulative_total"]}
\n
Date/Time:
${userData[index]["created_at"]}
"
,
child:
Text
(
"Hospital ID:
${userData[index]["hospital_id"]}
\n
${userData[index]["hospital"]["name"]}
\n
${userData[index]["hospital"]["name_si"]}
\n\n
Total Patients:
${userData[index]["cumulative_total"]}
\n
Date/Time:
${userData[index]["created_at"]}
"
,
...
...
lib/EAnalyzer/Loading.dart
View file @
e3e5cab2
...
@@ -21,13 +21,13 @@ class _LoadingScreenState extends State<LoadingScreen> {
...
@@ -21,13 +21,13 @@ class _LoadingScreenState extends State<LoadingScreen> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
backgroundColor:
Colors
.
green
.
shade300
,
backgroundColor:
Colors
.
lightGreen
[
400
]
,
body:
Stack
(
body:
Stack
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
DecorationImage
(
alignment:
Alignment
.
topC
enter
,
alignment:
Alignment
.
c
enter
,
image:
AssetImage
(
'lib/assets/images/eana.png'
),
image:
AssetImage
(
'lib/assets/images/eana.png'
),
))),
))),
]
]
...
...
lib/EAnalyzer/SearchEvent.dart
0 → 100644
View file @
e3e5cab2
import
'package:flutter/material.dart'
;
import
'package:cloud_firestore/cloud_firestore.dart'
;
import
'package:flutter_spinkit/flutter_spinkit.dart'
;
class
SearchEvent
extends
StatefulWidget
{
const
SearchEvent
({
Key
key
})
:
super
(
key:
key
);
@override
_SearchEventState
createState
()
=>
_SearchEventState
();
}
class
_SearchEventState
extends
State
<
SearchEvent
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
appBar:
AppBar
(
backwardsCompatibility:
false
,
backgroundColor:
Color
(
0xFF1B5E20
),
title:
Text
(
"Search an Event"
),
),
body:
ListPage
(),
);
}
}
class
ListPage
extends
StatefulWidget
{
@override
_ListPageState
createState
()
=>
_ListPageState
();
}
class
_ListPageState
extends
State
<
ListPage
>
{
Future
_data
;
Future
getRiskLocation
()
async
{
var
firestore
=
Firestore
.
instance
;
QuerySnapshot
qn
=
await
firestore
.
collection
(
"RiskLocation"
).
getDocuments
();
return
qn
.
documents
;
}
navigateToDetail
(
DocumentSnapshot
riskLocation
){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
DetailPage
(
riskLocation:
riskLocation
,)));
}
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_data
=
getRiskLocation
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
child:
FutureBuilder
(
future:
_data
,
// ignore: missing_return
builder:
(
_
,
snapshot
){
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
Center
(
child:
SpinKitFadingCircle
(
color:
Colors
.
green
,
size:
80.0
,
),
);
}
else
{
return
ListView
.
builder
(
itemCount:
snapshot
.
data
.
length
,
itemBuilder:
(
_
,
index
){
return
Card
(
elevation:
8
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
color:
Colors
.
lightGreen
[
100
],
child:
ListTile
(
leading:
Icon
(
Icons
.
location_city
,
size:
40
),
title:
Text
(
snapshot
.
data
[
index
].
data
()[
"hotelName"
],
style:
TextStyle
(
fontSize:
20.0
,
fontWeight:
FontWeight
.
bold
),),
subtitle:
Text
(
snapshot
.
data
[
index
].
data
()[
"riskLocation"
],
style:
TextStyle
(
fontSize:
16.0
),),
onTap:
()
=>
navigateToDetail
(
snapshot
.
data
[
index
]),
),
);
});
}
}
),
);
}
}
class
DetailPage
extends
StatefulWidget
{
final
DocumentSnapshot
riskLocation
;
DetailPage
({
this
.
riskLocation
});
@override
_DetailPageState
createState
()
=>
_DetailPageState
();
}
class
_DetailPageState
extends
State
<
DetailPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
backwardsCompatibility:
false
,
backgroundColor:
Color
(
0xFF1B5E20
),
title:
Text
(
widget
.
riskLocation
.
data
()[
"hotelName"
]),
),
body:
Container
(
width:
410
,
height:
100
,
child:
Card
(
elevation:
8
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
color:
Colors
.
lightGreen
[
50
],
child:
ListTile
(
leading:
Icon
(
Icons
.
timelapse
,
size:
40
),
title:
Text
(
"Date :
${widget.riskLocation.data()["date"]}
"
,
style:
TextStyle
(
fontSize:
20.0
,
fontWeight:
FontWeight
.
bold
),),
subtitle:
Text
(
"Time :
${widget.riskLocation.data()["time"]}
"
,
style:
TextStyle
(
fontSize:
20.0
,
fontWeight:
FontWeight
.
bold
),),
),
),
),
);
}
}
pubspec.lock
View file @
e3e5cab2
...
@@ -141,6 +141,13 @@ packages:
...
@@ -141,6 +141,13 @@ packages:
description: flutter
description: flutter
source: sdk
source: sdk
version: "0.0.0"
version: "0.0.0"
flutter_spinkit:
dependency: "direct main"
description:
name: flutter_spinkit
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.2+1"
flutter_svg:
flutter_svg:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
...
pubspec.yaml
View file @
e3e5cab2
...
@@ -32,6 +32,7 @@ dependencies:
...
@@ -32,6 +32,7 @@ dependencies:
quiver
:
^2.0.0
quiver
:
^2.0.0
wakelock
:
^0.1.4+1
wakelock
:
^0.1.4+1
charts_flutter
:
^0.9.0
charts_flutter
:
^0.9.0
flutter_spinkit
:
"
^4.1.2"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment