Based on:
How do I create an anonymous JavaScript function/callback with Dart's JS interop?
I have written this Dart function:
fadeIn(String selector) {
Completer completer = new Completer();
context.callMethod("\$", [selector]).callMethod("fadeIn", [FADE_SPEED, () {
print("callback");
completer.complete();
}]);
return completer.future;
}
Which should do (in JavaScript) $(selector).fadeIn( FADE_SPEED, function() { console.log("bacllback");.
However, when running this function in Dartium, I get the following exception:
Exception: type '() => dynamic' is not a subtype of type '(dynamic) => dynamic' of 'f'.
I don't understand the Exception. What have I done wrong?
The message "callback" does get printed out to the console though.