Answers for "run javascript in flutter"

0

run javascript in flutter

@JS() // Sets the context, which in this case is `window`
library main; // required library declaration called main, or whatever name you wish

import 'package:js/js.dart'; // Pull in our dependency

@JS('parent.jsFunction') // This marks the annotated function as a call to the function
external void jsFunction(dynamic command, dynamic arg);

void callJsFunction() {
  jsFunction('command', 'args'); // calls the function in javascript
}
Posted by: Guest on June-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language