update
This commit is contained in:
@ -52,6 +52,22 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
List<DropdownMenuItem<String>> getCustomArea(){
|
||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
||||
if(widget.indexController.areas.isNotEmpty){
|
||||
|
||||
for (Map<String, dynamic> currency in widget.indexController.areas[0]) {
|
||||
var newDropdown = DropdownMenuItem(
|
||||
child: Text(currency["area_nm"].toString()),
|
||||
value: currency["id"].toString(),
|
||||
);
|
||||
|
||||
dropDownItems.add(newDropdown);
|
||||
}
|
||||
}
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() =>
|
||||
@ -78,6 +94,29 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
items: getDropdownItems()
|
||||
),
|
||||
|
||||
// Custom events area
|
||||
widget.indexController.areas.isNotEmpty ?
|
||||
DropdownButton<String>(
|
||||
value: widget.indexController.areaDropdownValue,
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
elevation: 16,
|
||||
style: const TextStyle(color: Colors.deepPurple),
|
||||
hint: const Text("select"),
|
||||
underline: Container(
|
||||
height: 2,
|
||||
color: Colors.deepPurpleAccent,
|
||||
),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
if(newValue != null){
|
||||
widget.indexController.is_loading.value = true;
|
||||
widget.indexController.populateForCustomArea(newValue, widget.mapController);
|
||||
}
|
||||
});
|
||||
},
|
||||
items: getCustomArea(),
|
||||
): const Text(""),
|
||||
|
||||
widget.indexController.subPerfs.isNotEmpty ?
|
||||
|
||||
DropdownButton<String>(
|
||||
|
||||
Reference in New Issue
Block a user