blueloveTH 3 лет назад
Родитель
Сommit
c1d24406ac

+ 2 - 0
.github/workflows/main.yml

@@ -26,6 +26,8 @@ jobs:
     - name: Compiling
       run: |
         bash build_wasm.sh
+        mkdir -p output/web/lib
+        cp web/lib/* output/web/lib
     - uses: crazy-max/ghaction-github-pages@v3
       with:
         target_branch: gh-pages

+ 4 - 0
plugins/flutter/example/web/index.html

@@ -36,6 +36,10 @@
     // The value below is injected by flutter build, do not touch.
     var serviceWorkerVersion = null;
   </script>
+
+  <!-- This script initializes WASM of pocketpy -->
+  <script src="./lib/pocketpy.js"></script>
+
   <!-- This script adds the flutter initialization JS code -->
   <script src="flutter.js" defer></script>
 </head>

+ 1 - 1
plugins/flutter/lib/web.dart

@@ -43,7 +43,7 @@ class VM {
 
   PyOutput read_output() {
     var _o = _Bindings.pkpy_vm_read_output(pointer);
-    String _j = _o.toDartString();
+    String _j = _o;
     var ret = PyOutput.fromJson(cvt.jsonDecode(_j));
     _Bindings.pkpy_delete(_o);
     return ret;