Enum In Dart

Dart enum :

Enum In Dart
  • Group of named constants
  • enum is a keyword.
  • Zero based index starting from 0, 1, 2,…

For example :

enum Result { 
void main(){
      var result = Result.LoginSuccess;
      case Result.LoginSuccess:
           print("Login successfully");
      case Result.LoginFail:
           print("Mobile or email invalid");

Output: Login successfully

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in