update
This commit is contained in:
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/widgets/cat_widget.dart';
|
||||
|
||||
|
||||
class PerfectureWidget extends StatefulWidget {
|
||||
@ -97,6 +98,24 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
List<DropdownMenuItem<String>> getCategory(){
|
||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
||||
|
||||
dropDownItems.clear();
|
||||
|
||||
//print("--------cats ------############### ${widget.indexController.cats.toString()} -------------");
|
||||
for(dynamic d in widget.indexController.cats){
|
||||
print("-------- ddd ------############### ${d} --------dddd-----");
|
||||
var newDropdown = DropdownMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
|
||||
//print("--------cats ------############### ${d['category'].toString()} -------------");
|
||||
dropDownItems.add(newDropdown);
|
||||
}
|
||||
|
||||
//return [];
|
||||
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -155,7 +174,6 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
): const Text(""),
|
||||
|
||||
widget.indexController.subPerfs.isNotEmpty ?
|
||||
|
||||
DropdownButton<String>(
|
||||
value: widget.indexController.subDropdownValue,
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
@ -179,7 +197,31 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
items:
|
||||
getSubDropdownItems()
|
||||
) :
|
||||
const Text("")
|
||||
const Text(""),
|
||||
//CatWidget(indexController: widget.indexController,),
|
||||
DropdownButton<String>(
|
||||
value: widget.indexController.cateogory,
|
||||
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.populateForSubPerf(newValue, widget.mapController);
|
||||
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
|
||||
//widget.indexController.subDropdownValue = newValue;
|
||||
}
|
||||
});
|
||||
},
|
||||
items:
|
||||
getCategory(),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user