Skip to content

Instantly share code, notes, and snippets.

@rodydavis
Created March 6, 2024 21:16
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 rodydavis/96f4c7285452155ee5a9c28b8f42ce44 to your computer and use it in GitHub Desktop.
Save rodydavis/96f4c7285452155ee5a9c28b8f42ce44 to your computer and use it in GitHub Desktop.
Dart method calling
void main() {
myFunction(1, 2, c: 3, d: 4);
myFunction(1, c: 3, d: 4, 2);
myFunction(c: 3, d: 4, 1, 2);
myFunction(c: 3, 1, 2, d: 4);
myFunction.call(1, 2, c: 3, d: 4);
Function.apply(myFunction, [1, 2], {#c: 3, #d: 4});
}
void myFunction(int a, int b, {int? c, int? d}) {
print((a, b, c, d));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment