I'm writing a project and wants to add a DropDownButton but it always return error once I add onCnange event. Dropdown always returns error. I don't know what's wrong with it.
@override
Widget build(BuildContext context) {
return Material( child: Column( children: [
DropdownButton(items: [], value: dropdownValue, onChanged: (String value) {
setState(() {
dropdownValue = value;
});
},)
], ), );
}
Error message
The argument type 'void Function(String)' can't be assigned to the parameter type 'void Function(Object?)?'.