i was able to fire off an alert message from dart, but couldn\'t figure out how to call a function I wrote in another js file from dart. This would have been a great sellin
Maybe my answer will be worth it for somebody, so that's why I'm posting a simple JS function call from Dart.
dependencies:
js: any
example.js:
function test() {
return 12+20;
}
example.js above inside index.html with the tag.@JS()
library t;
import 'package:js/js.dart';
@JS()
external int Test();
class MyOwn {
int get value => Test();
}
@override
Future ngOnInit() async => print(MyOwn().value);