Last active
March 20, 2023 07:07
-
-
Save sdkdeepa/1f200a781f29b59dd2ab204b9bf9c926 to your computer and use it in GitHub Desktop.
Functions in dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//void returns nothing | |
//main() is the first method that dart will look for | |
void main() { | |
String greet = greetings(); | |
int age = getAge(); | |
print(greet); | |
print(age); | |
} | |
// functions which returns a string | |
// String greetings() { | |
// return 'Welcome to Flutter Basics'; | |
// } | |
// // functions which returns an int | |
// int getAge() { | |
// return 25; | |
// } | |
// Arrow function if returns a single value | |
String greetings() => 'Welcome to Flutter Basics'; | |
int getAge() => 25; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment