I have to communicate with a js code with lots of files and classes . the problem is that when I run runtime.evaluate("""${jsFile}myFunction()""");
the other classes can not be imported .
following is a simple example that what i need to do .
lets have two js files like following in the flutter assets folder .
first file : ClassOne.js
class ClassOne {
constructor() {
this.id = 1;
}
sayHi() {
console.log(`Hello from ${this.constructor.name} with ID: ${this.id}`);
}
}
and second file : ClassTwo.js
function myFunction( ) {
let j = new ClassTwo();
j.sayHi();
return 0 ;
}
I have to communicate with a js code with lots of files and classes . the problem is that when I run runtime.evaluate("""${jsFile}myFunction()"""); the other classes can not be imported . following is a simple example that what i need to do .
lets have two js files like following in the flutter assets folder . first file : ClassOne.js
class ClassOne { constructor() { this.id = 1; }
}
and second file : ClassTwo.js
function myFunction( ) { let j = new ClassTwo(); j.sayHi(); return 0 ; }
class ClassTwo extends ClassOne{ constructor() { super(); this.id = 2; }
}
Is it possible to import the first class in second one . ) runtime.evaluate("""${jsFile}myFunction()""");