1.Placed a js file in assets folder. 2.Added the path in pub spec.yaml 3.How do I invoke a function from a js file from flutter ?
I have tried the following approaches 1.String jsCode = await rootBundle.loadString('assets/temp.js'); but I am unable to invoke function of js file as it is a string. 2. imported flutter_js package but builds fails with compilation errors.
Path of js file is: assets/temp.js
Content of temp.js
function add(){
print("add");
}
snippet of pubspec.yaml flutter: assets: - assets/
Please help me out here, thank you.