mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
setToGlobalObject
This commit is contained in:
@@ -76,13 +76,13 @@ class _TestPageState extends State<TestPage> {
|
||||
_ensureEngine() {
|
||||
if (engine != null) return;
|
||||
engine = IsolateQjs(
|
||||
methodHandler: methodHandler,
|
||||
moduleHandler: (String module) async {
|
||||
if (module == "test") return "export default '${new DateTime.now()}'";
|
||||
return await rootBundle.loadString(
|
||||
"js/" + module.replaceFirst(new RegExp(r".js$"), "") + ".js");
|
||||
},
|
||||
);
|
||||
engine.setToGlobalObject("channel", methodHandler);
|
||||
}
|
||||
|
||||
@override
|
||||
|
Reference in New Issue
Block a user