How do you value an enum?

You cannot create an object of an enum explicitly so, you need to add a parameterized constructor to initialize the value(s) . The initialization should be done only once. Therefore, the constructor must be declared private or default. To returns the values of the constants using an instance method(getter).

Sizin İçin Seçtik  What is enum in Dart flutter?

Leave a Reply

Your email address will not be published. Required fields are marked *