I\'m still pretty new to Dart and the syntax of => (fat arrow) still confuses me (I come from C# background).
So in C# fat arrow ( => ) says: goes to so for
In Dart => xxx is just a syntaxic sugar to avoid { return xxx; }. Thus the two following functions are equivalent :
=> xxx
{ return xxx; }
var a = (String s) => s; var b = (String s) { return s; } ;
You can also use => on method definitions :
=>
String myFunc(String s) => s; String myFunc(String s) { return s; }