Skip to content

Instantly share code, notes, and snippets.

@Chralu
Last active September 7, 2022 15:44
Show Gist options
  • Save Chralu/9f182bf72693a92dd077d44cb2c270bd to your computer and use it in GitHub Desktop.
Save Chralu/9f182bf72693a92dd077d44cb2c270bd to your computer and use it in GitHub Desktop.
Flutter101 - Block/Expression body

Flutter101 - Block/Expression body

Created with <3 with dartpad.dev.

// Copyright (c) 2022, TheTribe.io
/// Exemple de fonction avec un Expression body
/// Notez la syntaxe "=>"
String getTextWithExpressionBody() => "Bonjour tout le monde";
/// Exemple de fonction avec un Block body
/// Elle est strictement équivalente à [getTextWithExpressionBody]
String getTextWithBlockBody() {
return "Bonjour tout le monde";
}
void main() {
final helloWorldText1 = getTextWithExpressionBody();
print(helloWorldText1);
final helloWorldText2 = getTextWithBlockBody();
print(helloWorldText2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment