Commit ce87967c authored by PiyumiD's avatar PiyumiD

Change some codes in searchevent.dart class

parent 3a6722e7
...@@ -320,7 +320,7 @@ Widget _buildTime(){ ...@@ -320,7 +320,7 @@ Widget _buildTime(){
SizedBox(height: 10), SizedBox(height: 10),
_buildTime(), _buildTime(),
//---------------------------------------------Submit-----------------------------------------------------
SizedBox(height: 50), SizedBox(height: 50),
RaisedButton( RaisedButton(
color: Colors.green, color: Colors.green,
...@@ -351,7 +351,7 @@ Widget _buildTime(){ ...@@ -351,7 +351,7 @@ Widget _buildTime(){
// } , // } ,
// ), // ),
//---------------------------------------------Update-----------------------------------------------------
RaisedButton( RaisedButton(
color: Colors.yellowAccent[700], color: Colors.yellowAccent[700],
child: Text( child: Text(
...@@ -364,7 +364,7 @@ Widget _buildTime(){ ...@@ -364,7 +364,7 @@ Widget _buildTime(){
} , } ,
), ),
//---------------------------------------------Delete-----------------------------------------------------
RaisedButton( RaisedButton(
color: Colors.red, color: Colors.red,
child: Text( child: Text(
......
...@@ -58,6 +58,7 @@ class EAnalyzerDash extends StatelessWidget { ...@@ -58,6 +58,7 @@ class EAnalyzerDash extends StatelessWidget {
primary: false, primary: false,
crossAxisCount: 2, crossAxisCount: 2,
children: <Widget>[ children: <Widget>[
//--------------------------------------Cards--------------------------------------------------------------------------------------
Card( Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)), borderRadius: BorderRadius.circular(8)),
......
...@@ -11,9 +11,10 @@ class _SearchEventState extends State<SearchEvent> { ...@@ -11,9 +11,10 @@ class _SearchEventState extends State<SearchEvent> {
String hotelName; String hotelName;
String district; String district;
int noOfInfected;
int nearToDistrict; int nearToDistrict;
int noOfPeople; int noOfPeople;
String date;
// int ima; // int ima;
// void riskLevel(){ // void riskLevel(){
...@@ -29,6 +30,10 @@ class _SearchEventState extends State<SearchEvent> { ...@@ -29,6 +30,10 @@ class _SearchEventState extends State<SearchEvent> {
this.district= district; this.district= district;
} }
getDate(noOfInfected){
this.noOfInfected= noOfInfected;
}
getNearDistrict(nearToDistrict){ getNearDistrict(nearToDistrict){
this.nearToDistrict= nearToDistrict; this.nearToDistrict= nearToDistrict;
} }
...@@ -37,9 +42,6 @@ class _SearchEventState extends State<SearchEvent> { ...@@ -37,9 +42,6 @@ class _SearchEventState extends State<SearchEvent> {
this.noOfPeople= noOfPeople; this.noOfPeople= noOfPeople;
} }
getDate(date){
this.date= date;
}
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
...@@ -119,8 +121,9 @@ Widget _buildDistrict(){ ...@@ -119,8 +121,9 @@ Widget _buildDistrict(){
); );
} }
//---------------------------------------------Near To District-----------------------------------------------------
Widget _buildNearToDistrict(){ //---------------------------------------------No Of Infected-----------------------------------------------------
Widget _buildNoOfInfected(){
return TextFormField( return TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
...@@ -131,27 +134,27 @@ Widget _buildNearToDistrict(){ ...@@ -131,27 +134,27 @@ Widget _buildNearToDistrict(){
borderSide: BorderSide(color: Colors.green), borderSide: BorderSide(color: Colors.green),
borderRadius: BorderRadius.all(Radius.circular(20)) borderRadius: BorderRadius.all(Radius.circular(20))
), ),
prefixIcon: Icon(Icons.location_on), prefixIcon: Icon(Icons.people_outlined),
hintText: "Ex : 0 or 1", hintText: "Ex : 250",
labelText: 'Near to District or not' labelText: 'No Of Infected People'
), ),
// ignore: missing_return // ignore: missing_return
validator: (String value){ validator: (String value){
if (value.isEmpty) { if (value.isEmpty) {
return '*This is Required'; return '*Date is Required';
} }
}, },
// onSaved: (String value){ // onSaved: (String value){
// _fName = value; // _fName = value;
// }, // },
onChanged: (String nearToDistrict){ onChanged: (String noOfInfected){
getNearDistrict(nearToDistrict); getNearDistrict(noOfInfected);
}, },
); );
} }
//---------------------------------------------No of people----------------------------------------------------- //---------------------------------------------Near To District-----------------------------------------------------
Widget _buildNoOfPeople(){ Widget _buildNearToDistrict(){
return TextFormField( return TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
...@@ -162,9 +165,9 @@ Widget _buildNoOfPeople(){ ...@@ -162,9 +165,9 @@ Widget _buildNoOfPeople(){
borderSide: BorderSide(color: Colors.green), borderSide: BorderSide(color: Colors.green),
borderRadius: BorderRadius.all(Radius.circular(20)) borderRadius: BorderRadius.all(Radius.circular(20))
), ),
prefixIcon: Icon(Icons.people_outline), prefixIcon: Icon(Icons.location_on),
hintText: "Ex : 250", hintText: "Ex : 0 or 1",
labelText: 'No Of People' labelText: 'Near to District or not'
), ),
// ignore: missing_return // ignore: missing_return
validator: (String value){ validator: (String value){
...@@ -175,14 +178,14 @@ Widget _buildNoOfPeople(){ ...@@ -175,14 +178,14 @@ Widget _buildNoOfPeople(){
// onSaved: (String value){ // onSaved: (String value){
// _fName = value; // _fName = value;
// }, // },
onChanged: (String noOfPeople){ onChanged: (String nearToDistrict){
getPeople(noOfPeople); getNearDistrict(nearToDistrict);
}, },
); );
} }
//---------------------------------------------Date----------------------------------------------------- //---------------------------------------------No of people-----------------------------------------------------
Widget _buildDate(){ Widget _buildNoOfPeople(){
return TextFormField( return TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
...@@ -193,25 +196,26 @@ Widget _buildDate(){ ...@@ -193,25 +196,26 @@ Widget _buildDate(){
borderSide: BorderSide(color: Colors.green), borderSide: BorderSide(color: Colors.green),
borderRadius: BorderRadius.all(Radius.circular(20)) borderRadius: BorderRadius.all(Radius.circular(20))
), ),
prefixIcon: Icon(Icons.calendar_today), prefixIcon: Icon(Icons.people_outline),
hintText: "Ex : 2021/04/03", hintText: "Ex : 250",
labelText: 'Date' labelText: 'No Of People'
), ),
// ignore: missing_return // ignore: missing_return
validator: (String value){ validator: (String value){
if (value.isEmpty) { if (value.isEmpty) {
return '*Date is Required'; return '*This is Required';
} }
}, },
// onSaved: (String value){ // onSaved: (String value){
// _fName = value; // _fName = value;
// }, // },
onChanged: (String date){ onChanged: (String noOfPeople){
getNearDistrict(date); getPeople(noOfPeople);
}, },
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -233,18 +237,19 @@ Widget _buildDate(){ ...@@ -233,18 +237,19 @@ Widget _buildDate(){
SizedBox(height: 10), SizedBox(height: 10),
_buildDistrict(), _buildDistrict(),
SizedBox(height: 10), SizedBox(height: 10),
_buildNoOfInfected(),
SizedBox(height: 10),
_buildNearToDistrict(), _buildNearToDistrict(),
SizedBox(height: 10), SizedBox(height: 10),
_buildNoOfPeople(), _buildNoOfPeople(),
// SizedBox(height: 10),
// _buildDate(),
SizedBox(height: 50), SizedBox(height: 50),
//Image(image: AssetImage('lib/assets/images/200.gif')), //Image(image: AssetImage('lib/assets/images/200.gif')),
Image.asset('lib/assets/images/200.gif',fit: BoxFit.contain,width: 150,height: 150,), Image.asset('lib/assets/images/200.gif',fit: BoxFit.contain,width: 150,height: 150,),
Center(child: Center(child:
Text('This is a Risk Location',style: TextStyle(fontSize: 25,fontWeight: FontWeight.bold, color: Colors.red[900]),)), Text('This is a risk area',style: TextStyle(fontSize: 25,fontWeight: FontWeight.bold, color: Colors.red[900]),)),
SizedBox(height: 10), SizedBox(height: 10),
RaisedButton( RaisedButton(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
......
...@@ -43,9 +43,9 @@ class _HomeScreenState extends State<HomeScreen> { ...@@ -43,9 +43,9 @@ class _HomeScreenState extends State<HomeScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
CircleAvatar( CircleAvatar(
radius: 32, radius: 55,
backgroundImage: NetworkImage( backgroundColor: Colors.transparent,
'https://upload.wikimedia.org/wikipedia/commons/a/a0/Pierre-Person.jpg'), backgroundImage: AssetImage('lib/assets/images/cdlogo2.png'),
), ),
SizedBox( SizedBox(
width: 16, width: 16,
......
...@@ -87,6 +87,9 @@ flutter: ...@@ -87,6 +87,9 @@ flutter:
- lib/assets/images/list80.png - lib/assets/images/list80.png
- lib/assets/images/search80.png - lib/assets/images/search80.png
- lib/assets/images/200.gif - lib/assets/images/200.gif
- lib/assets/images/cdlogo.png
- lib/assets/images/cdlogo1.png
- lib/assets/images/cdlogo2.png
- lib/assets/ - 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