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
8fc789d3
Commit
8fc789d3
authored
Jun 30, 2021
by
GayaniPKarunaratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Done some parts in Searchevent.dart page
parent
7cfdc22c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
3 deletions
+115
-3
lib/EAnalyzer/EAnalyzerDash.dart
lib/EAnalyzer/EAnalyzerDash.dart
+2
-1
lib/EAnalyzer/Loading.dart
lib/EAnalyzer/Loading.dart
+2
-2
lib/EAnalyzer/SearchEvent.dart
lib/EAnalyzer/SearchEvent.dart
+111
-0
No files found.
lib/EAnalyzer/EAnalyzerDash.dart
View file @
8fc789d3
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/Loading.dart
View file @
8fc789d3
...
@@ -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 @
8fc789d3
import
'package:flutter/material.dart'
;
import
'package:cloud_firestore/cloud_firestore.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:
Text
(
"Loading...."
),
);
}
else
{
return
ListView
.
builder
(
itemCount:
snapshot
.
data
.
length
,
itemBuilder:
(
_
,
index
){
return
Card
(
child:
ListTile
(
title:
Text
(
snapshot
.
data
[
index
].
data
()[
"hotelName"
]),
subtitle:
Text
(
snapshot
.
data
[
index
].
data
()[
"riskLocation"
]),
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
(
child:
Card
(
child:
ListTile
(
title:
Text
(
widget
.
riskLocation
.
data
()[
"date"
]),
subtitle:
Text
(
widget
.
riskLocation
.
data
()[
"time"
]),
),
),
),
);
}
}
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