It is now possible to constrain a generic type to an Enum since Dart 2.16.
You can do so in a following way:
class MyClass<T extends Enum> {}
Now you can pass to the generic parameter T
of MyClass
only enum.
It is now possible to constrain a generic type to an Enum since Dart 2.16.
You can do so in a following way:
class MyClass<T extends Enum> {}
Now you can pass to the generic parameter T
of MyClass
only enum.