Open pkmangukiya opened 4 years ago
@lcuis :- If you know anything about this, let us know quickly.
When i waiting for api response List<DropdownMenuItem> stateDropdownItems;
@override void initState() { getState(param); super.initState(); } void getState(Map param) { ApiManager.instance.postAPICall(BASE_URL + get_city, param).then( (value) async { stateList = (jsonDecode(value) as List<dynamic>) .map<StateModel>((e) => StateModel(e['name'], e['city_id'])) .toList(); stateDropdownItems = stateList .map<DropdownMenuItem<StateModel>>((e) => DropdownMenuItem( child: Text(e.name), value: e, )) .toList(); }, onError: (error) { }); } SearchableDropdown( items: stateDropdownItems, hint: Text('Select a State'), searchHint: new Text( 'Search a State', ), onChanged: (value) { setState(() { selectedState = value; }); }, isExpanded: true, )
@lcuis :- If you know anything about this, let us know quickly.
When i waiting for api response List<DropdownMenuItem> stateDropdownItems;