I\'m trying to create a simple dialog in Dart and I thought it was easier to use existing javascript libraries. Here you can find the basic example, basically
$(
You can need just to be notified on callback. There is quick fix:
class CallbackFunction implements Function {
final Function f;
CallbackFunction(this.f);
call() => throw new StateError('There should always been at least 1 parameter'
'(js this).');
noSuchMethod(Invocation invocation) {
Function.apply(f, []);
}
}
.callMethod("spinner", [new js.JsObject.jsify({
"stop": new js.JsFunction.withThis(new CallbackFunction(recalc),
"page": 1,
"step": 0.1
})])
void recalc(){
print("recalcing");
}
You can parse invocation argument to read javascript callback arguments. Source: 'package:js/js.dart':line 238 (may change)