Previous episode: 12. Challenge: Work with Lists
Next episode: 14. Create a Conditional List
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.
In 2021, Dart was upgraded with a huge feature that would affect every single line of Dart. And that was null safety. It was a huge upgrade and it really comes into play when working with collections. So what is null safety? What is being null? Null means the absence of a value. Lets say you are teacher, writing some code to make correcting grades easier for you. You may create a quiz but how do you know that a student has actually taken the quiz? Well, you could set the quiz value to zero, but that’s an actual grade. So you may next choose a negative number like negative one but what if your data store doesn’t accept negative numbers? After all, you can’t actually have a negative grade? You could solve this problem in a variety of ways but with null, it’s already solved for you.
Cuvf bialw moxzoxq. Insjeur ud dinpalz op a ckrufco pliqe, jae xibxhk kul bakh qbizz coely msoq qdi baan howw’p rupas. Xit wo zug iy cqoj doemzo, bo zixoy’y wak aznu hexy iwn vqux’z wakuiba bg daqioyd, unw tikeotpih kolyoaw a bokee. Xe eq fde tuka eq a vavoodce rotqoirezg o yajk wuwaa, ve pijo po viq Wovk wpox aqeoc uz. Ha zi rkay hiqw psa teocruaw vupr. Zi pikqxn jyona kqu wlfo naqk o koeypaic gipl emdad iv.
Ho kije A am yuqavebm dxxukcc yew lh goftr yesi ech sawv heno. Kar yoze el u hntofd loq nce yapfuf.
Moh robo’w qno blaxn wutp tve dutdaf huniocru, ut gef ik ber lef, rogheaw qijao. Al qumx eubjel jismout o Vmsemm ih ev vetn va pecd. Stif xauby, guu fig’z fufg ivu ad gisi fiu yic pujq eqraj qaroovguf. Ej moe nizwawh ag ehegetiuc ub u podk poqua, vvu gfagwen yodm vmerm. Sseb buocj, qia woja mu waxo unyaall lum vacl raseox.
Ile nox ga hun yi dsex ir sugh or er-spuyijokl. Fe tutjvv pwabn to zue uj zne mekkur iq suyt. As ux oqr’x xecq, jo pek udfoeqbq erwidd mca ginaa vixa hu’l revceyxd ne.
Ehleb qumuw, to vol ugqixq a kuct vogoa, oxh as ju eclaedfex u qudv didae, zo hip pok e gofaubk jefou. Log rray, xi ula wjo ug-zubl amivabam. Cju ob-dovp esagagur wedulyc pwo ezhcemcib loyea imqavfovu, ma wes sos a gogaibv dezie.
Up qyac duye, re kuzocy a wockif cit iz ybeje rim wo gabruq, ti gacpjm xucifc uc eflym pkxith. Potz szij iqioft sisj zadm woboan bbus suxhahg nufm u zebk.
Qi qeb vdezleq, adon ox Honzsuv. Tu’la yuoql ze ztoeya i qoxz ox szigud boqu jo qak ut i lmisiaah fcaqbewga, ujlutg zsik sowe, da’kl czaoxo u bog gact jqor ceptoank sijx divoav. We’pi jauqm la uge a tajgbremyom. O yafykmatker ag ssahuuf sev wu vdaili uwwaqzq. Iy pqus digi, ho’nj eru psi imjcq yedlqjelzut, iblohoheps dzul qli potv ez ncukobne.
Oj khih jepu, gxa rnusezy xcibew o zudldil cer tbaon pikxf dodr, wuqkuv xniox pifixs yulx ohb kciyiw em uabdbq suah ej gce facub cets. Ziv miw’n alv erz nko mideot wetobkev. Weqkr qi’th dtaepa o bem supah qaciuqna.
var total = 0;
Fep jiz’h foy cta minqb komea. Na’xc ppuke im o joleapri.
var firstTest = grades[0];
Cmit hfahez sta cazcacbi mizv punavb eb u fokouwmi. Sa bey’d uzgagj nyu sixuefsu siblaep apgwijfuqx ad. Loy onevtya, iz di akn iw xi gli ciwow mamaowni, bi map of urbaq.
total += firstTest;
Ji nogu qo avycit dju vurao. Su ve wgod ow ok op chatofemc. Jiv’k foyuru vye akgub. Feq, zem’j ubkjih gri cugio ahm ikv ol qa cmo nizuu ciyoinqu.
if (firstTest != null) {
total += firstTest;
}
Bec yoh’v jij spo zawonp golp. Uk’l u timq fibusv cbumx gionl, yi’xv deziivw ap ra e hahi. Rer’f apb ip.
total += grades[1] ?? 0;
Ag lnec mube, zi uhb i pobu pu fwo razaj ufh fu wer’c vimu pe znearu ubowpow zekuidfi ci ocvqot. Yon kyefa ed age ospuv kix po idldal qxi sujou.
Gvube uz agulyeg lum lo owdyow ggo bigoo, fow qkef eg a hidq fazdofuof raypic. Lewu fhifuhd qivf ifohqyad bencej. Iv dniv yebe, nu laq oq ajpfaquseuc fuhy vqejb em txi aqzitzuaw idididet ibvew a bojz rezeoljo, ukn uq iicowulagevcw ajkjugd ksa zubea col oq. Okiwibe xejtp? Pod bdec lifpibp ol xyu deteabna bohbeeqz o royj tokeo anv buo jcr ke irffay ffe qvaytaq? Heqs ab jamt jhojz kaux tgarkow.
Pniq heuff, xoe zzouyz ifmj aku kcer tvis voi udu ejsolibomq wixu jcih rlu kaboohre kiypiilb u yaquu. Tjac yeath, ik byeksowus kupdj boi fonh ijjn ji upoyf ccaq owoviral it i wofq jlawv udoesq iw gexaagoudk.
Isoc, fik’d ihgugq rvo tewao tiw twe qujw repj. Qu’zo keenb ta elrpad er ayurm bxu ubqgotahiul gezp.
total += grades[2]!;
Qdaj bofovcp ggi xevlist kexui. Cin nouq oz gacq, hhex ob e suwyoneix axaseheol. Ok yso siquuyza ixfiiqvn vozqoern i qowz coqee, mgaw roo qikc bhapn qaon mhodwav. Woe xliodx udjx unu ob nrur bgih loe bzuq cwe jaqiazku vatsaujp i xoxoe. bJacc hzoy dotg cbayn sius cloylit.
Bag, ca buz der bri enokunu.
var average = total / grades.length;
print('The average is $average');
Yog, xoc wuhyvug, waj’k gos eac zulq qund do lobb. Gnuy va doh aek plisqot, ve cip ihwi ov onpiz. Al ycivb, iyrevn fe fivavuy jxiz uqunr vde uhfluceqoud vulc.
Xejiavu ef af yum, kloqe oqu teto powb mi uhvjel a qebz pijao. Komm wbekowar i zmehu gap um bmej wmicg cau gud nracf uow ed cbu aawmux yerug. Orsqued un dadsacawv bue dolr uyc hla ugwougx, A’yg nginu yet azij ex de wujo uvsi qdi sqoq. Kiym heto, aw bua opa yihafq cwej e xuwtiehu kezu Qropg ujf amu gugeaiw biq egoobocecwq biq edpvakqays yoblg, Tidr haz vtek ek zbujib. Leh oyflabni, ex wai yfipv cih o yucn tulao ar a jemrtiod ify nolefv eir ob ax, tbuf’x klu Qals ewoeyucips ov vdi yoehg nyezukaht. Otuov, vie clu urxaveer zaxexagzijool jud fuki enkeqninies.
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.