Dart Tutorial #15 - Switch case in Dart Programming
ฝัง
- เผยแพร่เมื่อ 14 เม.ย. 2022
- Dart Tutorial #15 - Switch case in Dart Programming
In this video by Programming for Beginners we will see Switch case in Dart Programming, using Dart Tutorial videos. We can learn Dart Programming language to make web applications or mobile applications using flutter framework. Also we can make single-page web applications using Dart programming.
Switch statement in dart programming can help us as an alternative to if else statement in coding. Switch keyword checks the variable expression for a specific value and executes lines of code based on the variable value. Below is the format of switch statement in dart programming:
switch (i){
case 0: {}
break;
case 1: {}
break;
default: {}
break;
}
Dart Tutorial Playlist:
• Dart Tutorial
VS Code Editor:
code.visualstudio.com/download
Online Dartpad:
dartpad.dartlang.org/
Dart SDK:
www.dartlang.org/install/arch...
TH-cam Gears:
Microphone: amzn.to/3iIk5K3
Mouse: amzn.to/35irmNF
Laptop: amzn.to/3iG0jyD
#Dart #Tutorial #Programming
============================
LIKE | SHARE | COMMENT | SUBSCRIBE
Thanks for watching :)
Sir could you help me, how is this different from doing if, else if, else statements. Or if it is the same is the switch case faster? Why would somebody use this switch case vs the if, else if, else?
The functionality is same irrespective of what we use between if, else and switch.. switch cases are more readable and faster when we have many conditions to be checked