remove handler when destroy

This commit is contained in:
ekibun
2020-08-28 10:46:54 +08:00
parent 178b74b770
commit 89ea0222be
6 changed files with 48 additions and 24 deletions

View File

@@ -3,7 +3,7 @@
* @Author: ekibun
* @Date: 2020-08-08 08:16:50
* @LastEditors: ekibun
* @LastEditTime: 2020-08-27 20:55:04
* @LastEditTime: 2020-08-27 21:11:55
-->
# flutter_qjs
@@ -71,7 +71,8 @@ dart("http", "http://example.com/");
```dart
await engine.setModuleHandler((String module) async {
return await rootBundle.loadString("js/" + module.replaceFirst(new RegExp(r".js$"), "") + ".js");
return await rootBundle.loadString(
"js/" + module.replaceFirst(new RegExp(r".js$"), "") + ".js");
});
```