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
233464ef
Commit
233464ef
authored
Jun 13, 2021
by
GayaniPKarunaratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
90% done in get data from ApI
parent
92e94b98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
lib/EAnalyzer/HospitalDetails.dart
lib/EAnalyzer/HospitalDetails.dart
+14
-14
No files found.
lib/EAnalyzer/HospitalDetails.dart
View file @
233464ef
import
'package:covidefender/EAnalyzer/AddLocation.dart'
;
import
'package:flutter/material.dart'
;
import
'dart:async'
;
import
'dart:convert'
;
...
...
@@ -34,11 +35,10 @@ class _HospitalDetailsState extends State<HospitalDetails> {
Future
getData
()
async
{
http
.
Response
response
=
await
http
.
get
(
"https://reqres.in/api/users?page=2"
);
http
.
Response
response
=
await
http
.
get
(
"https://www.hpb.health.gov.lk/api/get-current-statistical"
);
data
=
json
.
decode
(
response
.
body
);
setState
(()
{
userData
=
data
[
"data"
];
userData
=
data
[
"data"
]
[
"hospital_data"
]
;
});
debugPrint
(
userData
.
toString
());
}
...
...
@@ -67,20 +67,20 @@ class _HospitalDetailsState extends State<HospitalDetails> {
padding:
const
EdgeInsets
.
all
(
12.0
),
child:
Row
(
children:
<
Widget
>[
CircleAvatar
(
backgroundImage:
NetworkImage
(
userData
[
index
][
"avatar"
])
,
),
//
CircleAvatar(
//
backgroundImage: NetworkImage(userData[index]["avatar"]) ,
//
),
Padding
(
padding:
const
EdgeInsets
.
all
(
12.0
),
child:
Text
(
"
${userData[index]["first_name"]}
${userData[index]["last_name
"]}
"
,
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
"]}
"
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w700
,
),),
),
Text
(
"
${userData[index]["id
"]}
"
),
Text
(
"
${userData[index]["email"]}
"
),
// Text("\n\n\n\n\n\n\n\n\n${userData[index]["created_at
"]}"),
//
Text("${userData[index]["email"]}"),
],
),
),
...
...
@@ -121,9 +121,9 @@ class _HospitalDetailsState extends State<HospitalDetails> {
}
//-----------------------------------------Class Hospital--------------------------------------------------
class
Hospital
{
final
String
updateDateTim
e
;
final
String
localNewCases
;
//
class Hospital{
// final String dat
e;
// final String count
;
// final String hospitalId;
// final String hospital;
// final String cumulativeLocal;
...
...
@@ -131,5 +131,5 @@ class Hospital{
// final String createdAt;
//Hospital(this.hospitalId,this.hospital,this.cumulativeLocal,this.cumulativeForeign,this.createdAt);
Hospital
(
this
.
updateDateTime
,
this
.
localNewCases
);
}
\ No newline at end of file
// Hospital(this.date,this.count);
// }
\ No newline at end of file
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