Skip to content

Instantly share code, notes, and snippets.

@onumanfj
Created June 19, 2023 16:07
Show Gist options
  • Save onumanfj/31e0cbfe912d644848ba05fe4d0c4f8e to your computer and use it in GitHub Desktop.
Save onumanfj/31e0cbfe912d644848ba05fe4d0c4f8e to your computer and use it in GitHub Desktop.
dart - function
void main() {
//call function
greet();
greetPerson('Francis');
int result = sumFunc(2,4);
print(result);
}
//named function w/o input or output
void greet(){
print('Hello Francis');
}
//named function w/ input
void greetPerson(String personToGreet){
print('Howdy, $personToGreet.');
}
//named function w/ input & output
int sumFunc(int num1, int num2){
return num1 + num2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment