run javascript in flutter

Solutions on MaxInterview for run javascript in flutter by the best coders in the world

showing results for - "run javascript in flutter"
Amaya
06 Sep 2017
1@JS() // Sets the context, which in this case is `window`
2library main; // required library declaration called main, or whatever name you wish
3
4import 'package:js/js.dart'; // Pull in our dependency
5
6@JS('parent.jsFunction') // This marks the annotated function as a call to the function
7external void jsFunction(dynamic command, dynamic arg);
8
9void callJsFunction() {
10  jsFunction('command', 'args'); // calls the function in javascript
11}
12