i am trying to use a container to select a dropdown menu by wrapping the dropdown button with a container and then use a Gesture Detector. but i am getting an error
The argument type 'void Function(String?)' can't be assigned to the parameter type 'void Function()?'
but if i make use of the unchange function on the dropdown menu its working fine
GestureDetector(
onTap: (String? newValue){
setState(() {
dropdowntargetGroupValue = newValue!;
});
},
child: DropdownButtonHideUnderline(
child: DropdownButton(
value: dropdowntargetGroupValue,
icon: Visibility(
visible: false, child: Icon(Icons.arrow_downward)),
items: targetGroup.map((String items) {
return DropdownMenuItem(
value: items, child: Text(items));
}).toList(),
onChanged: (String? newValue) {
setState(() {
dropdowntargetGroupValue = newValue!;
});
},
),
),
),