Answers for "switch case in flutter"

10

switch case in dart

switch(variable_expression) { 
   case constant_expr1: { 
      // statements; 
   } 
   break; 
  
   case constant_expr2: { 
      //statements; 
   } 
   break; 
      
   default: { 
      //statements;  
   }
   break; 
}
Posted by: Guest on June-09-2020
6

flutter switch

bool isChecked = false;
Switch(
            value: isChecked,
            onChanged: (bool value) { 
              setState(() {
                isChecked = value;
              });
             }, 
            ),
Posted by: Guest on August-28-2021
5

switch case in flutter

void main() { 
   var grade = "A"; 
   switch(grade) { 
      case "A": {  print("Excellent"); } 
      break; 
     
      case "B": {  print("Good"); } 
      break; 
     
      case "C": {  print("Fair"); } 
      break; 
     
      case "D": {  print("Poor"); } 
      break; 
     
      default: { print("Invalid choice"); } 
      break; 
   } 
}
Posted by: Guest on October-19-2020

Browse Popular Code Answers by Language