I would like to know the syntax to set a multiple case statement in a switch / case.
For example :
String commentMark(int mark) {
switch (mark) {
case 0 : // Enter this block if mark == 0
return "Well that's bad" ;
case 1, 2, 3 : // Enter this block if mark == 1 or mark == 2 or mark == 3
return "Gods what happend" ;
// etc.
default :
return "At least you tried" ;
}
}
I cannot find the right syntax to set multiple case (the line case 1, 2, 3 :
), is it even possible in Dart ?
I did not found any informations on pub.dev documentation, neither on dart.dev.
I tried :
case 1, 2, 3
case (1, 2, 3)
case (1 ; 2 ; 3)
case (1 : 2 : 3)
case 1 : 3
and more !