Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

switch case flutter

String commentMark(int mark) {
    switch (mark) {
        case 0 : // Enter this block if mark == 0
            return "mark is 0" ;
        case 1:
        case 2:
        case 3: // Enter this block if mark == 1 or mark == 2 or mark == 3
            return "mark is either 1, 2 or 3" ;
        // etc.
        default :
            return "mark is not 0, 1, 2 or 3" ;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #switch #case #flutter
ADD COMMENT
Topic
Name
1+2 =