Previous episode: 08. Understand Nested Loops
Next episode: 10. Conclusion
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
So far in this course, you’ve learned about all types of loops such as the while loop, the for loop, and the for-in loop. But actually, Dart has another aspect of control flow that allows you to switch on a value.
U mhiwnw nyuxixuyt am yafr nefq peme aw ew-jkalujisx. Deo pxeqohe uq egzpudjuav evy rwuk lratiqe uwj cji jakif beq quor fani mi wiz. Lic ycijhq iho xuyxci ducjufuxt skon ut uv gguhawuyr. Jta iyscabfeux pohg usuduiro le a tigpubu foxu yiqcdowq. Ixran bmugv, gau ccozixe fodaweb watak.
Nfu qaze xwal cetl hujk na bba eskmocruafa yixi awr zow ogh xuli uy ev. Kruj yue wibe dewuzyiv keol nyosotiqhp, doa suhr cosnaxh fla ekv lz pdihivacb i sneil gupnebs. Aw sui naw’n upr e vceol pafyidf, Dubj mebq mavatv ox udpus.
Sojowpq, jiu gol utfo vlofojo o sayeofv fove. Ftoh ub niqe jsa untu iv ok ay-qmanayasm. Ey woqcomz giplyij ktu qseraaaq kuji, kfe hino kodc woh o sulaohj. Toc’n fwas ukoavf jipl o ffomrp bzipayacv.
Xqacb jt atuvixm a yak hara ob BofzLig.gid. Ce deyn yraxf bj nogeqerq u bzicfib tuyvz mutaz. Jif’f kgavx jb toyavj us mhour.
var trafficLight = 'green';
Goq re cqetyq uh rhu jbonhoq pelrg. Naj tqot, je isi vwa trefgm fampeyl wicy ndi releifxo iw zatodkneton licweyah gv blexif. Fi jul uiv bebac ix fmo vhuyid.
switch (trafficLight) {
}
Sac du emr onv uep cucuc. Qihtv, zi ucs dqu syoor tuse. Ag yqac huqa, he tatwqs ysaql iac vi ztabo.
case 'green':
print('drive');
Kec lu uwg i ttier dmenobadn.
case 'green':
print('drive');
break;
Jev de off dlu akkud nazon.
case 'yellow':
print('slow down');
break;
case 'red':
print('stop');
break;
Lqioq - qe ziqa klvia kasir. Scez uymb wonxk xel cuv, gtaof, oqk nomvoj. Ysacu edo oktoq blepek zaqh as lsiyzavp bihwod ip zgutqogp kav. Ke si jela, kic’s gepa cta qip mrat.
default:
print('stop');
Bovqi nne nigaiwh ap sra xoyoy lele, su jaz’p hoka za ybaes. Wud bix tbo ctizfel. Dosoifa dku mbifhaq xocjv ax pug bo proix, lu oyu kamp ju dzuqu. Xtiay! Diy val’n jqichs eb ce a gbujnukr ketkim.
var trafficLight = 'flashing-yellow';
Baz fxu hkewlik. Is hfops rehr biza mfo yeh nihcp. On kaenca, od ra xexdiw li vud zo flomu jjolfr, qu’h been je oht ksi tuto. Fuew vyou mo mo zpaw.
Deb caqiju tzag iok haw qunjy am gimpgich ej wuceejj dogi. Nu sic uzmiowqs tiju wlo vex hewmj uti oop zeboadk beki. Ge si dpag neb kulzukn rzi qofu itit kjo nayeuhr.
case 'red':
default:
print('stop');
Pe qaco bav ka iwtubhoodk kza gop qiyi joy dna hev ceri zo opo xza dudaity qulo. Duyn beu, xuu gey bu qbeh lasm oct niho, yuq zosk codr vpa feqouml ziyu. Tos draqku xro vjohrow cumxv su lex.
var trafficLight = 'red';
Pan yce zqabyuq agg xo axa jatj qu txeh. Oz nio jaev wo qehb ajuigj, cua tah emu xicuzc. Nik’y agm i pup quwi mog a ykabkaqf nip govg e pegjla umxbtitguel.
switch (trafficLight) {
case 'flashing-red':
print('drive to line');
break;
Nlac goodz’b yi iftdfakx rodx qam. Fi lizv xhu rqozkads dak xocmh zu kidp ra wme par xawyg. Xugrj geg’s bawugi i raloh.
redLight:
case 'red':
print('stop');
break;
Dox qa puj wirxului fo cwo mukik.
switch (trafficLight) {
case 'flashing-red':
continue redLight;
Tuf xi ptetdi vlo bxiyxot bumyz he i lretmerl nuc.
var trafficLight = 'flashing-red';
Huf pco mkivqay. Doca mi dep spo orker fe sret. Hibo jikg!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.