Commit 885a0ba4 authored by indika N kumara's avatar indika N kumara

Merge branch 'EAnalyzer_KarunaratneGP' into 'develop_1'

E analyzer karunaratne gp

See merge request !26
parents 4aac3c3f c15ed477
This diff is collapsed.
import 'package:covidefender/EAnalyzer/HospitalDetails.dart';
import 'package:covidefender/EAnalyzer/HotelMap.dart';
import 'package:covidefender/EAnalyzer/SearchEvent.dart';
import 'package:flutter/material.dart';
import 'AddLocation.dart';
import 'RiskEventList.dart';
class EAnalyzerDash extends StatelessWidget {
@override
......@@ -56,6 +58,7 @@ class EAnalyzerDash extends StatelessWidget {
primary: false,
crossAxisCount: 2,
children: <Widget>[
//--------------------------------------Cards--------------------------------------------------------------------------------------
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
......@@ -107,7 +110,7 @@ class EAnalyzerDash extends StatelessWidget {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => EAnalyzerDash()),
MaterialPageRoute(builder: (context) => RiskEventList()),
);
},
child: Image.asset('lib/assets/images/list80.png'),
......@@ -156,6 +159,26 @@ class EAnalyzerDash extends StatelessWidget {
],
)
),
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
elevation: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => HotelMap()),
);
},
child: Image.asset('lib/assets/images/feedback80.png'),
),
Text('Hotel Map', style: TextStyle(fontSize: 20.0))
],
)
),
],
),
)
......
......@@ -72,6 +72,9 @@ class _HospitalDetailsState extends State<HospitalDetails> {
padding: const EdgeInsets.all(12.0),
child: Row(
children: <Widget>[
// CircleAvatar(
// ),
Padding(
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\nTotal Patients: ${userData[index]["cumulative_total"]}\nDate/Time: ${userData[index]["created_at"]}",
......
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class HotelMap extends StatefulWidget {
@override
_HotelMapState createState() => _HotelMapState();
}
class _HotelMapState extends State<HotelMap> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
backgroundColor: Color(0xFF1B5E20),
title: Text("Hotel Google Map"),
),
body: Center(
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: GoogleMap(
initialCameraPosition: CameraPosition(
target: LatLng(7.8731, 80.7718),
zoom: 8.0,
),
),
),
),
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class RiskEventList extends StatefulWidget {
const RiskEventList({ Key key }) : super(key: key);
@override
_RiskEventListState createState() => _RiskEventListState();
}
class _RiskEventListState extends State<RiskEventList> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
backwardsCompatibility: false,
backgroundColor: Color(0xFF1B5E20),
title: Text("Search Risk Hotels"),
),
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: MediaQuery.of(context).size.width,
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),),
),
),
),
);
}
}
This diff is collapsed.
......@@ -27,7 +27,7 @@ class _HomeScreenState extends State<HomeScreen> {
body: Stack(
children: <Widget>[
Container(
height: size.height * .2,
//height: size.height * .2,
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
......@@ -44,11 +44,11 @@ class _HomeScreenState extends State<HomeScreen> {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// CircleAvatar(
// radius: 32,
// backgroundImage: NetworkImage(
// 'https://upload.wikimedia.org/wikipedia/commons/a/a0/Pierre-Person.jpg'),
// ),
CircleAvatar(
radius: 55,
backgroundColor: Colors.transparent,
backgroundImage: AssetImage('lib/assets/images/cdlogo2.png'),
),
SizedBox(
width: 16,
),
......
......@@ -91,6 +91,12 @@ flutter:
- lib/assets/images/feedback80.png
- lib/assets/images/list80.png
- lib/assets/images/search80.png
- lib/assets/images/101.gif
- lib/assets/images/102.gif
- lib/assets/images/103.gif
- lib/assets/images/cdlogo.png
- lib/assets/images/cdlogo1.png
- lib/assets/images/cdlogo2.png
- lib/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