Switch Case Example Program in Dart


Example Program:

Here is the simple program for printing basic example of switch case in dart.

Source Code

enum status{Yes,No,Cancel}
void main(){
 switch(status.Yes)
 {
  case status.Yes:
     print('User Pressed Yes');
     break;
  case status.No:
     print('User Pressed No');
     break;
  case status.Cancel:
     print('User Pressed Cancel');
     break;
 }

}
To download raw file Click Here

Output

User Pressed Yes


Learn All in Tamil © Designed & Developed By Tutor Joes