Created
August 28, 2019 09:07
-
-
Save filiph/1a39a1d60b36f39f0bfe375f29566af5 to your computer and use it in GitHub Desktop.
How to define function signature without a typedef
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
| 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