Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart enum

enum Status { 
   none, 
   running, 
   stopped, 
   paused 
}  
void main() { 
   print(Status.values); 
   Status.values.forEach((v) => print('value: $v, index: ${v.index}'));
   print('running: ${Status.running}, ${Status.running.index}'); 
   print('running index: ${Status.values[1]}'); 
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #dart #enum
ADD COMMENT
Topic
Name
4+8 =