Check out example codes for "switch case in dart". It will help you in understanding the concepts better.

Code Example 1

switch(variable_expression) { 
   case constant_expr1: { 
      // statements; 
   } 
   break; 
  
   case constant_expr2: { 
      //statements; 
   } 
   break; 
      
   default: { 
      //statements;  
   }
   break; 
}

Learn ReactJs, React Native from akashmittal.com