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
20521bef
Commit
20521bef
authored
Jul 25, 2021
by
GayaniPKarunaratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Connect Flutter app to python model
parent
c9037d98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
10 deletions
+64
-10
.vscode/launch.json
.vscode/launch.json
+15
-0
lib/EAnalyzer/SearchEvent.dart
lib/EAnalyzer/SearchEvent.dart
+49
-10
No files found.
.vscode/launch.json
0 → 100644
View file @
20521bef
{
//
Use
IntelliSense
to
learn
about
possible
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"Python: Current File"
,
"type"
:
"python"
,
"request"
:
"launch"
,
"program"
:
"${file}"
,
"console"
:
"integratedTerminal"
}
]
}
\ No newline at end of file
lib/EAnalyzer/SearchEvent.dart
View file @
20521bef
// import 'dart:convert';
// import 'dart:html';
import
'dart:convert'
;
import
'dart:ffi'
;
import
'package:flutter/material.dart'
;
import
'package:cloud_firestore/cloud_firestore.dart'
;
// import 'package:cloud_firestore/cloud_firestore.dart';
import
'package:http/http.dart'
as
http
;
class
SearchEvent
extends
StatefulWidget
{
...
...
@@ -11,9 +19,9 @@ class _SearchEventState extends State<SearchEvent> {
String
hotelName
;
String
district
;
int
noOfInfected
;
int
nearToDistrict
;
int
noOfPeople
;
String
noOfInfected
;
String
nearToDistrict
;
String
noOfPeople
;
// int ima;
...
...
@@ -30,7 +38,7 @@ class _SearchEventState extends State<SearchEvent> {
this
.
district
=
district
;
}
get
Date
(
noOfInfected
){
get
Infected
(
noOfInfected
){
this
.
noOfInfected
=
noOfInfected
;
}
...
...
@@ -145,10 +153,10 @@ Widget _buildNoOfInfected(){
}
},
// onSaved: (String value){
//
_fName
= value;
//
noOfInfected
= value;
// },
onChanged:
(
String
noOfInfected
){
get
NearDistrict
(
noOfInfected
);
get
Infected
(
noOfInfected
);
},
);
}
...
...
@@ -215,6 +223,32 @@ Widget _buildNoOfPeople(){
);
}
Future
Getdata
(
url
)
async
{
http
.
Response
Response
=
await
http
.
get
(
url
);
return
Response
.
body
;
}
Future
<
void
>
check
()
async
{
String
urls
=
'https://eanalyzer.herokuapp.com/api/eanalyzer?NoInfected='
+
noOfInfected
.
toString
()+
'&NearToDistrict='
+
nearToDistrict
.
toString
()+
'&NoOfPeople='
+
noOfPeople
.
toString
();
var
Data
=
await
Getdata
(
urls
);
var
reText
=
jsonDecode
(
Data
);
print
(
reText
);
// var ex = [2];
if
(
reText
.
toString
()
==
'[0]'
)
{
print
(
"Low Risk"
);
}
else
if
(
reText
.
toString
()
==
'[1]'
)
{
print
(
"Moderate Risk"
);
}
else
if
(
reText
.
toString
()
==
'[2]'
)
{
print
(
"High Risk"
);
}
// print("sss");
// print(reText);
}
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -262,9 +296,14 @@ Widget _buildNoOfPeople(){
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
),
),
onPressed:
()
{
if
(!
_formKey
.
currentState
.
validate
())
{
return
;
}
// if(!_formKey.currentState.validate()) {
// return;
//}
//String urls = 'https://eanalyzer.herokuapp.com/api/eanalyzer?NoInfected='+noOfInfected.toString()+'&NearToDistrict='+nearToDistrict.toString()+'&NoOfPeople='+noOfPeople.toString();
// var Data = await Getdata(urls);
// var reText = jsonDecode(Data);
check
();
// riskLevel();
}
,
),
...
...
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