Skip to content

Instantly share code, notes, and snippets.

@filiph
Created August 28, 2019 09:07
Show Gist options
  • Select an option

  • Save filiph/1a39a1d60b36f39f0bfe375f29566af5 to your computer and use it in GitHub Desktop.

Select an option

Save filiph/1a39a1d60b36f39f0bfe375f29566af5 to your computer and use it in GitHub Desktop.
How to define function signature without a typedef
main() {
takesFunction((x) => "result: $x");
}
void takesFunction(String Function(int) callback) {
final result = callback(42);
print(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment