How to bind an enum to DropdownButton in Flutter?
First, you need to update your DropdownButton type argument to ClassType and not String. In Dart, an enum declaration creates a new type, not Strings. DropdownButton(…); Next, you need to change the enum names. An enum has to be a valid dart identifier, meaning it can’t contain the symbol -. enum ClassType {A, B, C, … Read more