Member-only story

Enhanced Enums in Flutter 3

Enums were good. Now they’re great.

Code on the Rocks
3 min readMay 12, 2022

Flutter 3

Flutter 3.0 was announced at Google IO yesterday and as can be expected from a major version jump, there were a lot of new features to dig through. A few of the big ones:

  • Stable support for macOS and Linux apps
  • Improved Firebase integration
  • Material 3 support
  • Foldable phone support
  • iOS release improvements
  • Performance improvements for the web
  • Theme extensions

You can read more about the full release in the announcement here and if you’re someone that wants to see everything that was added, check out the release notes.

Enhanced Enums

The feature that excited me the most didn’t quite make it into the announcement articles, though. Flutter 3.0* also shipped with full support for enhanced enums, meaning that your enums can now behave like mini-classes with members and methods.

Before now, enums were extremely simple — basically just lists of values. If you wanted to make them more useful, you’d need to extend them…

--

--

Responses (2)