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
366cec46
Commit
366cec46
authored
May 05, 2021
by
GayaniPKarunaratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create add location form
parent
3580ec87
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
213 additions
and
10 deletions
+213
-10
lib/EAnalyzer/AddLocation.dart
lib/EAnalyzer/AddLocation.dart
+213
-2
lib/EAnalyzer/EAnalyzerDash.dart
lib/EAnalyzer/EAnalyzerDash.dart
+0
-1
lib/STracker/levelsDashboard.dart
lib/STracker/levelsDashboard.dart
+0
-3
lib/STracker/strackerDashboard.dart
lib/STracker/strackerDashboard.dart
+0
-3
lib/home_screen.dart
lib/home_screen.dart
+0
-1
No files found.
lib/EAnalyzer/AddLocation.dart
View file @
366cec46
...
...
@@ -6,10 +6,221 @@ 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
;
final
GlobalKey
<
FormState
>
_formKey
=
GlobalKey
<
FormState
>();
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
;
},
);
}
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
;
},
);
}
Widget
_buildAge
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Age'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Age is Required'
;
}
},
onSaved:
(
String
value
){
_age
=
value
;
},
);
}
Widget
_buildAddress
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Address'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Address is Required'
;
}
},
onSaved:
(
String
value
){
_address
=
value
;
},
);
}
Widget
_buildNIC
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'NIC'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*NIC is Required'
;
}
},
onSaved:
(
String
value
){
_nic
=
value
;
},
);
}
Widget
_buildPhoneNumber
(
){
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
;
},
);
}
Widget
_buildRiskLocation
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Risk Location'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Location is Required'
;
}
},
onSaved:
(
String
value
){
_riskLocation
=
value
;
},
);
}
Widget
_buildHotelName
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Hotel Name'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Hotel Name is Required'
;
}
},
onSaved:
(
String
value
){
_hotelName
=
value
;
},
);
}
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
;
},
);
}
Widget
_buildTime
(
){
return
TextFormField
(
decoration:
InputDecoration
(
labelText:
'Time'
),
validator:
(
String
value
){
if
(
value
.
isEmpty
)
{
return
'*Time is Required'
;
}
},
onSaved:
(
String
value
){
_time
=
value
;
},
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Scaffold
(
appBar:
AppBar
(
backwardsCompatibility:
false
,
backgroundColor:
Color
(
0xFF1B5E20
),
title:
Text
(
"Add Risk Location"
),
),
body:
Container
(
margin:
EdgeInsets
.
all
(
24
),
child:
Form
(
key:
_formKey
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
_buildFName
(),
_buildLName
(),
_buildAge
(),
_buildAddress
(),
_buildNIC
(),
_buildPhoneNumber
(),
_buildRiskLocation
(),
_buildHotelName
(),
_buildDate
(),
_buildTime
(),
SizedBox
(
height:
100
),
RaisedButton
(
child:
Text
(
'Submit'
,
style:
TextStyle
(
color:
Colors
.
green
,
fontSize:
18
),
),
onPressed:
()
{
if
(!
_formKey
.
currentState
.
validate
())
{
return
;
}
_formKey
.
currentState
.
save
();
print
(
_fName
);
print
(
_lName
);
print
(
_age
);
print
(
_address
);
print
(
_nic
);
print
(
_phoneNumber
);
print
(
_riskLocation
);
print
(
_hotelName
);
print
(
_date
);
print
(
_time
);
}
,
)
],
),),
),
);
}
}
\ No newline at end of file
lib/EAnalyzer/EAnalyzerDash.dart
View file @
366cec46
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'AddLocation.dart'
;
class
EAnalyzerDash
extends
StatelessWidget
{
...
...
lib/STracker/levelsDashboard.dart
View file @
366cec46
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'home.dart'
;
...
...
@@ -14,8 +13,6 @@ class _levelsDashboardState extends State<levelsDashboard> {
return
Scaffold
(
appBar:
AppBar
(
backwardsCompatibility:
false
,
systemOverlayStyle:
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
blue
.
shade900
),
title:
Text
(
"Levels DashBoard"
),
),
body:
Stack
(
...
...
lib/STracker/strackerDashboard.dart
View file @
366cec46
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'levelsDashboard.dart'
;
...
...
@@ -14,8 +13,6 @@ class _strackerDasboardState extends State<strackerDasboard> {
return
Scaffold
(
appBar:
AppBar
(
backwardsCompatibility:
false
,
systemOverlayStyle:
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
blue
.
shade900
),
title:
Text
(
"STracker DashBoard"
),
),
body:
Stack
(
...
...
lib/home_screen.dart
View file @
366cec46
import
'package:covidefender/STracker/splash.dart'
;
import
'package:covidefender/EAnalyzer/Loading.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
class
HomeScreen
extends
StatefulWidget
{
_HomeScreenState
createState
()
=>
_HomeScreenState
();
...
...
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