there should be exactly one item with a dropdown value error

Just remove the initialisation of _location_id from your initState() method.

You have initialised the _location_id with empty string that’s the reason DropDownButton is looking for empty string id in your list items which is not present and the error has been thrown.

Solution Just remove the initialisation of _location_id from your initState() method.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top