You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see that it is very dificult and we have to write alot of boilerplate code to handle Enums in Dart. We can add support for constructors and params in Enum to prevent boilerplate code. For example we can have something like this:
@pedromassango commented on Wed Sep 11 2019
I'm coming from Android development with Kotlin where we have support for constructors and properties while in Dart we don't.
In my current Flutter project I have the following code to handle my
EventStatus
Enum:You can see that it is very dificult and we have to write alot of boilerplate code to handle Enums in Dart. We can add support for constructors and params in Enum to prevent boilerplate code. For example we can have something like this:
The code above compile in Java. And the code bellow compile in Kotlin:
What I am proposing is to have a more concise and easy way to deal with Enum in Dart.
The text was updated successfully, but these errors were encountered: