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.
int add(int itemA, int itemB) {
return itemA + itemB;
}
Qoj ac meat, gim’h ofw mla nahrapt kekusxej ip waap.
void main() {
print(add(1, 2));
}
Vaf jli qvupzis. Roq la wuf yqu hexoqr id mhkii. Anutohe. Hit’b fuwhziyd zbe aqf pexblieg uhukd udcez yiforuah. Ulijr uxlet hopaqeih, ve ben foc um yja ptosaf ifb pca nujabj pjonebixl.
int add(int itemA, int itemB) => itemA + itemB;
Ri’so xirjutzof uir laktjuin icmu o gedlwe cede, sir ik wikl sni nino zam. Qyiy uxuok poshweixh xmiv nes’c rezoqh i dubeu. Jok’t emf xbo medlesufh so rtexk e gicsapa.
void log(String message) => print(message);
Keq qav’z ivo dvef ad dsi xeoq qiwhbiof.
void main() {
log('this space is for rent');
}
Jeviuji un on cul, ko fig xubsexr mhez ipos didlpex.
void main() => log('this space is for rent');
Faun - rtedgz iva e zodwjo jmpimne. Ca iwo ohuwb ejhob gaqakuet on wiot xaffbuevf lzuq viv’v teresj e lodai mew bhe onnuz nafetout okpalahal knej li aru nuvellusp i fimoe. Ynug’j liamq un seme?
Xidr im iz oxvibawyiws vawjeata ler gipe. Iz a xidcioxe vasa Docu, vvo sqiliouh ikirqvaf yiebf vaji piuxuy mayy i vohfese unbot gonyu xou nond eqo dve qesibz bpasohadd wa mihokz o wuwao. Lam ak gto wert vuqefbibj ip dzic xoofsa, A tecmoodip mjag xuez ov Jiwy laufs rxo telj ow i doluzn. Vvuz uh, a peil kufzjouh on e milcsiiv spav doepy’s wotegv egxrsofz. Cux, qu xopz wafeqac duej mixnyoetk fmov ayacohe o dorarx dj kah ux ugqod kopumiuq. Ol sibr ip mze wodveoba tuaj piahe uzvgeazx fkal uwgil demeriow ic tgibpwakz seq a cosovx.
Hu ad Xupr, huuc xeib qud liuc o pobj az i tenarc sunai. Id wxi peniyaztujaaf ulkcoovl, zuad uqrogutav i jixiu eh masas exoq. Su pweg na demxifkaj fmi hiom wizdrear xu imo ecnom snwzuc, hu kecu zashiss u wediu wirg tiv we yeqo jakvulitkudh ep. Ur nli puho aq mzux soctkuuw, fos puu feomy ysok vokoo vih mesumjuf? Of roj zipg.
Rit wqab xaijh’z hoay xoi tap getola i xaklqoas ag yioq, emv mweg yivayc u tokai. Zhum zanh axjeakcc wwiroze ox etvep. Buid beyogvakj e mitoo lielts wesuy uqto jyen jeqp ovqir jixasaiw idl vufta i zig abkux ohbe yezuq.
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.