Skip to content

Instantly share code, notes, and snippets.

@erluxman
Last active April 13, 2020 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erluxman/fa46336f5c1b3287c6420d3b3a277178 to your computer and use it in GitHub Desktop.
Save erluxman/fa46336f5c1b3287c6420d3b3a277178 to your computer and use it in GitHub Desktop.
FunctionnArguments
void main() {
f2(f1, 3);
f2(f1, 4);
f2(f1, 7);
f2(f1, 9);
}
f1(int evenOrOdd) {
print("$evenOrOdd is ${evenOrOdd % 2 == 0 ? "Even" : "Odd"}");
}
f2(Function(int) evenOrOddFunction, int argumentToPass) {
evenOrOddFunction(argumentToPass);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment