DropdownButton<String>(
value: _selectedFilterOption,
icon: const Icon(Icons.filter_alt),
onChanged: (String? newValue) {
setState(() {
_selectedFilterOption = newValue!;
debugPrint(
"selected filter option: $_selectedFilterOption");
// Reset other filter options when switching to a new filter
if (_selectedFilterOption !=
AppLocalizations.of(context)!.gender) {
_selectedGender = 'All';
}
if (_selectedFilterOption !=
AppLocalizations.of(context)!
.location) {
_selectedLocation = 'All';
}
if (_selectedFilterOption !=
AppLocalizations.of(context)!
.priority) {
_selectedPriority = 'All';
}
});
debugPrint(
"setselected value confirm : $_selectedFilterOption");
// Fetch data based on the selected filter option
fetchFilderOptionData();
},
items: <String>[
AppLocalizations.of(context)!.filter_by,
AppLocalizations.of(context)!.gender,
AppLocalizations.of(context)!.location,
AppLocalizations.of(context)!.priority,
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
how to fix the issue
New contributor
Deeps Sara is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.