Commit 504be5aa authored by GayaniPKarunaratne's avatar GayaniPKarunaratne

Modifications in dropdown

parent 85d1704e
......@@ -8,6 +8,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:http/http.dart' as http;
import 'package:quiver/testing/time.dart';
class SearchEvent extends StatefulWidget {
......@@ -25,10 +26,26 @@ class _SearchEventState extends State<SearchEvent> {
String noOfPeople;
int ima;
//final List<String> dist = ['ampara', 'anuradhapura', 'badulla', 'batticaloa','colombo','galle','gampaha','hambantota','jaffna','kalmunai','kalutara','kandy','kegalle','kilinochchi','kurunagala','mannar','matale','matara','monaragala','mullaitivu','nuwara eliya','polonnaruwa','puttalam','ratnapura','trincomalee','vavuniya'];
var finalRisk = 'rrrr';
var tcVisibility = false;
var now = new DateTime.now();
//var yesterday = now.subtract(const Duration(days: 1));
// var formatterDate = new DateFormat('dd');
// var formatterMonth = new DateFormat('MM');
// var formatterYear = new DateFormat('yyyy');
// String date = formatterDate.format(yesterday);
// String month = formatterMonth.format(yesterday);
// String year = formatterYear.format(yesterday);
// String finalDate = '_' + year + '_' + month + '_' + date
// String riskLevelDocument = location + finalDate;
// int ima;
// void riskLevel(){
......@@ -106,7 +123,14 @@ Widget _buildHotelName(){
//---------------------------------------------District-----------------------------------------------------
Widget _buildDistrict(){
return TextFormField(
return DropdownButtonFormField(
items: <String>['ampara','anuradhapura','badulla','batticaloa','colombo','galle','gampaha','hambantota','jaffna','kalmunai','kalutara','kandy','kegalle','kilinochchi','kurunagala','mannar','matale','matara','monaragala','mullaitivu','nuwara eliya','polonnaruwa','puttalam','ratnapura','trincomalee','vavuniya']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.indigo[900]),
......@@ -126,6 +150,13 @@ Widget _buildDistrict(){
return '*District is Required';
}
},
// items: dist.map((distr){
// return DropdownMenuItem(
// value: distr,
// child: Text('$dist'),
// );
// }),
//------------------------------------------------------
// onSaved: (String value){
// _fName = value;
// },
......@@ -169,7 +200,14 @@ Widget _buildNoOfInfected(){
//---------------------------------------------Near To District-----------------------------------------------------
Widget _buildNearToDistrict(){
return TextFormField(
return DropdownButtonFormField(
items: <String>['0','1']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.indigo[900]),
......@@ -298,7 +336,9 @@ Future<void> check() async{
// child:
// Text('This is a $finalRisk area',style: TextStyle(fontSize: 25,fontWeight: FontWeight.bold, color: Colors.red[900]),)),
// SizedBox(height: 10),
Visibility(
visible: tcVisibility,
child: new Column(
......@@ -331,6 +371,7 @@ Future<void> check() async{
),
onPressed: () {
check();
Visibility();
// if(!_formKey.currentState.validate()) {
// return;
......@@ -340,7 +381,9 @@ Future<void> check() async{
// var reText = jsonDecode(Data);
// riskLevel();
} ,
},
),
],
......
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