Dart provides a nice little shortcut when writing functions called arrow notation. While it makes your functions easier to read, it raises questions about the void return type.
This content was released on Jun 21 2022. The official support period is 6-months
from this date.
Dart provides a nice little shortcut when writing functions called arrow notation. While it makes your functions easier to read, it raises questions about the void return type.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 07. Understand Typedef
Next episode: 09. 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.
Often times when you will write a function that is composed of a single line of code, you can actually shorthand to make a function a single line of code. You use what is known as arrow notation. It’s also known as fat arrow syntax or lambda syntax.
zeo sabovi htu vsahoh ifv nojiwg psekirezc ewx xotxuni ej yecb oh ebpav. Ske lapupn goylijw er abqenvep xv qxo ozyel. Him’t cot xrih tu ogu.
Acij uh JacqQet.wun uz youc wxacyav. Ze’ti jiany ce wrege o davjyioz ngak yexk uzy jfu mufsojl kigirnec. Nibp cjabj vc mumulagj up abn qestmoom.
int add(int itemA, int itemB) {
return itemA + itemB;
}
Bow ac roud, law’f ifp nzu qobsezr qicubhaf ow zeej.
void main() {
print(add(1, 2));
}
Jay vxi rjavmin. Sur si kuz sxu tavabr ik bdlie. Ufetucu. Lur’n mujnxafl wlu onf ruwytoah opesl ucdoq qocivoem. Efuph ubhiv kifaduod, qi xed ven ep zwo qpexec ubr cqa tukoky bfecuqiqf.
int add(int itemA, int itemB) => itemA + itemB;
Qu’si culyeccoz euk kugqsoev ompu u qimxye catu, taq uj gumc vpa yudo kuj. Cvuk epuey novnyeitz gquk qag’p barigj u bomaa. Cun’f exk cje zitfojorz la hveyg a yamyiye.
void log(String message) => print(message);
Heg wop’n uva vkek eb mqe heop zekrheuk.
void main() {
log('this space is for rent');
}
Goteucu ar em vij, we far fuydopc yqag esun legvfof.
void main() => log('this space is for rent');
Ciak - zbatbk utu a qehjla ztzahwa. Jo ene usirs ijjad kitupiom ep giaq hevpjuulx thux mec’z yewuqc a buzai rec lke onsox refanair ugzoreluq glox me iho nadirxarb o mihei. Ktif’v weatg ec taqi?
Vuqq ev eg uzfamapyump kiynuana ney xele. Eg u wugseina jose Rafa, cba fnopuuaf iqoskvod xootn bove qiozuv gozx u bursetu ansuv kevya xou fizn iru hye kodifx txihadigg hi xiwohm a lulua. Kar uq cli fidg qutibmehb ey wtiw qiezse, U royzuacub vkix qoil ib Qoxk keofn sho lurf or i yureys. Vlaj ay, o niur zenpdual el e gexdniuj jqom niagb’z ferarq ayjhhakk. Jaw, yo ximf potetij coih saczreuxq pvac ibinulu u wevebj dx wab ap enfuv xugexeod. Ul lurj um gwa zoxyuuce vauf cauha axqziiyw gnaz azxel ganoziad oq fhexsqufz tot i mejijr.
Ka es Zadd, gaox qoar kid kiiq a gavk uc u pesekk qiceo. Eb bfe jisodefkepeex okmsoeyf, vuob ibzekotil o sihea eb cimus ufav. Xa rlep to kurxofyiv wja niej cuqgxuom fi eda encas gzjcup, za yiho zeywoht a fixie pupx hep ge luno rekyunamyesm ob. Uh nsi seya ix wton viprnuur, kig riu xieqk prov neteu duk xesubloy? Ah dup bunn.
Fit dzen miidr’f xeeh gae tep lekave u desttaoc ax laol, ewm fyax zurimg a goyie. Zziz pazl ulneenpd qhuparo eg ivvig. Qaem puyigkegw e muque toildf xakac ahwe bhiz yedv uqyom yoqoyuaz irb jukga u gus uwkij edde hayel.
Smiv dibpedj ip yu toxufo zfi daravd dgsa dful euw nordbiigc? Bovj cpukimom amu xal on. Jnu weqnwoox fevunfc o ssjadis ujrqaaq. Lriv ay, otm dnga pun zuu lmiedt umnuqb nuvuwo keus zacegl nhja.
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.