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
963a4206
Commit
963a4206
authored
May 25, 2021
by
Indika NK
Browse files
Options
Browse Files
Download
Plain Diff
Resolved conflicts of EAnalyzer and IGuider Merge
parents
8448922a
e2b4bc7d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
323 additions
and
105 deletions
+323
-105
android/app/build.gradle
android/app/build.gradle
+4
-0
android/app/google-services.json
android/app/google-services.json
+40
-0
android/build.gradle
android/build.gradle
+1
-0
lib/EAnalyzer/AddLocation.dart
lib/EAnalyzer/AddLocation.dart
+109
-104
lib/main.dart
lib/main.dart
+8
-1
pubspec.lock
pubspec.lock
+161
-0
No files found.
android/app/build.gradle
View file @
963a4206
...
...
@@ -61,4 +61,8 @@ flutter {
dependencies
{
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
'com.google.firebase:firebase-analytics'
}
apply
plugin:
'com.android.application'
apply
plugin:
'com.google.gms.google-services'
android/app/google-services.json
0 → 100644
View file @
963a4206
{
"project_info"
:
{
"project_number"
:
"206817019032"
,
"firebase_url"
:
"https://covidefender-5b8b1-default-rtdb.firebaseio.com"
,
"project_id"
:
"covidefender-5b8b1"
,
"storage_bucket"
:
"covidefender-5b8b1.appspot.com"
},
"client"
:
[
{
"client_info"
:
{
"mobilesdk_app_id"
:
"1:206817019032:android:8c981d64ba61069de4bced"
,
"android_client_info"
:
{
"package_name"
:
"com.example.covidefender"
}
},
"oauth_client"
:
[
{
"client_id"
:
"206817019032-grv9328g4hup8db6vp987rt6nmrdmd3b.apps.googleusercontent.com"
,
"client_type"
:
3
}
],
"api_key"
:
[
{
"current_key"
:
"AIzaSyDTZ7KVRrYQylCKI58uqhe6ugoKhti1t8E"
}
],
"services"
:
{
"appinvite_service"
:
{
"other_platform_oauth_client"
:
[
{
"client_id"
:
"206817019032-grv9328g4hup8db6vp987rt6nmrdmd3b.apps.googleusercontent.com"
,
"client_type"
:
3
}
]
}
}
}
],
"configuration_version"
:
"1"
}
\ No newline at end of file
android/build.gradle
View file @
963a4206
...
...
@@ -8,6 +8,7 @@ buildscript {
dependencies
{
classpath
'com.android.tools.build:gradle:4.1.0'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
'com.google.gms:google-services:4.3.8'
}
}
...
...
lib/EAnalyzer/AddLocation.dart
View file @
963a4206
import
'package:flutter/material.dart'
;
import
'package:cloud_firestore/cloud_firestore.dart'
;
class
AddLocation
extends
StatefulWidget
{
@override
...
...
@@ -7,119 +8,113 @@ class AddLocation extends StatefulWidget {
class
AddLocationState
extends
State
<
AddLocation
>
{
String
_fName
;
String
_lName
;
String
_age
;
String
_address
;
String
_nic
;
String
_phoneNumber
;
String
_riskLocation
;
String
_hotelName
;
String
_date
;
String
_time
;
String
userName
;
String
phoneNumber
;
String
riskLocation
;
String
hotelName
;
String
date
;
String
time
;
final
GlobalKey
<
FormState
>
_formKey
=
GlobalKey
<
FormState
>();
getUserName
(
name
){
this
.
userName
=
name
;
}
Widget
_buildFName
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'First Name'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*First Name is Required'
;
}
},
onSaved:
(
String
value
){
_fName
=
value
;
},
);
getPhoneNumber
(
pno
){
this
.
phoneNumber
=
pno
;
}
Widget
_buildLName
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Last Name'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Last Name is Required'
;
}
},
onSaved:
(
String
value
){
_lName
=
value
;
},
);
getRiskLocation
(
location
){
this
.
riskLocation
=
location
;
}
Widget
_buildAge
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Age'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Age is Required'
;
}
},
onSaved:
(
String
value
){
_age
=
value
;
},
);
getHotelName
(
hotelname
){
this
.
hotelName
=
hotelname
;
}
Widget
_buildAddress
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Address'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Address is Required'
;
}
},
onSaved:
(
String
value
){
_address
=
value
;
},
);
getDate
(
date
){
this
.
date
=
date
;
}
getTime
(
time
){
this
.
time
=
time
;
}
createData
(){
print
(
"object"
);
DocumentReference
documentReference
=
Firestore
.
instance
.
collection
(
"RiskLocation"
).
document
(
userName
);
Map
<
String
,
dynamic
>
locations
={
"userName"
:
userName
,
"phoneNumber"
:
phoneNumber
,
"riskLocation"
:
riskLocation
,
"hotelName"
:
hotelName
,
"date"
:
date
,
"time"
:
time
};
documentReference
.
setData
(
locations
).
whenComplete
(()
{
print
(
"
$userName
created"
);
});
}
Widget
_buildNIC
(
){
final
GlobalKey
<
FormState
>
_formKey
=
GlobalKey
<
FormState
>();
//---------------------------------------------User Name-----------------------------------------------------
Widget
_buildName
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'
NIC
'
),
decoration:
InputDecoration
(
labelText:
'
Full Name
'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*
NIC
is Required'
;
return
'*
Full Name
is Required'
;
}
},
onSaved:
(
String
value
){
_nic
=
value
;
// onSaved: (String value){
// _fName = value;
// },
onChanged:
(
String
name
){
getUserName
(
name
);
},
);
}
Widget
_buildPhoneNumber
(
){
//---------------------------------------------Phone Number-----------------------------------------------------
Widget
_buildPNo
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Phone Number'
),
keyboardType:
TextInputType
.
phone
,
maxLength:
10
,
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Phone Number is Required'
;
}
},
onSaved:
(
String
value
){
_phoneNumber
=
value
;
// onSaved: (String value){
// _lName = value;
// },
onChanged:
(
String
id
){
getPhoneNumber
(
phoneNumber
);
},
);
}
Widget
_buildRiskLocation
(
){
//---------------------------------------------Risk Location-----------------------------------------------------
Widget
_buildLocation
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Risk Location'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Location is Required'
;
return
'*
Risk
Location is Required'
;
}
},
onSaved:
(
String
value
){
_riskLocation
=
value
;
// onSaved: (String value){
// _age = value;
// },
onChanged:
(
String
riskLocation
){
getRiskLocation
(
riskLocation
);
},
);
}
//---------------------------------------------Hotel Name-----------------------------------------------------
Widget
_buildHotelName
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Hotel Name'
),
...
...
@@ -128,37 +123,49 @@ Widget _buildHotelName(){
return
'*Hotel Name is Required'
;
}
},
onSaved:
(
String
value
){
_hotelName
=
value
;
// onSaved: (String value){
// _address = value;
// },
onChanged:
(
String
hotelName
){
getHotelName
(
hotelName
);
},
);
}
//---------------------------------------------Date-----------------------------------------------------
Widget
_buildDate
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Date'
),
keyboardType:
TextInputType
.
datetime
,
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Date is Required'
;
}
},
onSaved:
(
String
value
){
_date
=
value
;
// onSaved: (String value){
// _nic = value;
// },
onChanged:
(
String
date
){
getDate
(
date
);
},
);
}
//---------------------------------------------Time-----------------------------------------------------
Widget
_buildTime
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Time'
),
keyboardType:
TextInputType
.
phone
,
maxLength:
10
,
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Time is Required'
;
}
},
onSaved:
(
String
value
){
_time
=
value
;
// onSaved: (String value){
// _phoneNumber = value;
// },
onChanged:
(
String
time
){
getTime
(
time
);
},
);
}
...
...
@@ -177,18 +184,15 @@ Widget _buildTime(){
child:
Form
(
key:
_formKey
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
_buildFName
(),
_buildLName
(),
_buildAge
(),
_buildAddress
(),
_buildNIC
(),
_buildPhoneNumber
(),
_buildRiskLocation
(),
_buildHotelName
(),
_buildDate
(),
_buildTime
(),
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
_buildName
(),
_buildPNo
(),
_buildLocation
(),
_buildHotelName
(),
_buildDate
(),
_buildTime
(),
SizedBox
(
height:
100
),
RaisedButton
(
...
...
@@ -201,23 +205,24 @@ Widget _buildTime(){
return
;
}
_formKey
.
currentState
.
save
();
//
_formKey.currentState.save();
print
(
_fName
);
print
(
_lName
);
print
(
_age
);
print
(
_address
);
print
(
_nic
);
print
(
_phoneNumber
);
print
(
_riskLocation
);
print
(
_hotelName
);
print
(
_date
);
print
(
_time
);
// print(_fName);
// print(_lName);
// print(_age);
// print(_address);
// print(_nic);
// print(_phoneNumber);
// print(_riskLocation);
// print(_hotelName);
// print(_date);
// print(_time);
createData
();
}
,
)
],
),),
),
...
...
lib/main.dart
View file @
963a4206
import
'package:firebase_core/firebase_core.dart'
;
import
'package:flutter/material.dart'
;
import
'home_screen.dart'
;
void
main
(
)
=>
runApp
(
MyApp
());
// void main() => runApp(MyApp());
void
main
(
)
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
await
Firebase
.
initializeApp
();
runApp
(
MyApp
());
}
class
MyApp
extends
StatelessWidget
{
Widget
build
(
BuildContext
context
)
{
...
...
pubspec.lock
View file @
963a4206
...
...
@@ -15,6 +15,22 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
camera:
dependency: "direct main"
description:
path: "packages/camera/camera"
ref: HEAD
resolved-ref: a2ce3dab466125c86e275e70cb04355a8c3daa16
url: "http://github.com/indikaNK/plugins.git"
source: git
version: "0.8.1"
camera_platform_interface:
dependency: transitive
description:
name: camera_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
characters:
dependency: transitive
description:
...
...
@@ -29,6 +45,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charts_common:
dependency: transitive
description:
name: charts_common
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0"
charts_flutter:
dependency: "direct main"
description:
name: charts_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0"
clock:
dependency: transitive
description:
...
...
@@ -36,6 +66,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
cloud_firestore:
dependency: "direct main"
description:
name: cloud_firestore
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.4"
cloud_firestore_platform_interface:
dependency: transitive
description:
name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
cloud_firestore_web:
dependency: transitive
description:
name: cloud_firestore_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1+2"
collection:
dependency: transitive
description:
...
...
@@ -43,6 +94,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1+1"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -57,6 +115,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.3"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1+1"
flutter:
dependency: "direct main"
description: flutter
...
...
@@ -74,6 +153,39 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
intl:
dependency: transitive
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
...
...
@@ -88,6 +200,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
oktoast:
dependency: "direct main"
description:
name: oktoast
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.2"
path:
dependency: transitive
description:
...
...
@@ -109,6 +228,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.0"
petitparser:
dependency: transitive
description:
...
...
@@ -116,6 +242,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
quiver:
dependency: "direct main"
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -142,6 +282,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
...
...
@@ -163,6 +310,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
tflite:
dependency: "direct main"
description:
name: tflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
typed_data:
dependency: transitive
description:
...
...
@@ -177,6 +331,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
wakelock:
dependency: "direct main"
description:
name: wakelock
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4+2"
xml:
dependency: transitive
description:
...
...
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