E.g. in Typescript I'd have:
function foo(callback: (num) => string) {
console.log(callback(1));
}
And even in C/C++ you can do it using an insane syntax:
void foo(string (*callback)(int)) {
cout << callback(5) << "\n";
}
How do I do the same in Dart without resorting to typedef
?