flutter_quickjs 1.0.0 copy "flutter_quickjs: ^1.0.0" to clipboard
flutter_quickjs: ^1.0.0 copied to clipboard

outdated

Flutter bindings for QuickJS with dart:ffi.

flutter_quickjs #

Flutter bindings with dart:ffi for QuickJS:A small Javascript engine supports ES2020.

Supports iOS, Android.

Install #

To use this plugin, add flutter_quickjs as a dependency in your pubspec.yaml file.

Usage #

import 'package:flutter/material.dart';
import 'package:flutter_quickjs/flutter_quickjs.dart';

void main() {
  var evalResult = runJs();
  runApp(
    MaterialApp(
      home: Material(
        child: Center(
          child: Text(evalResult),
        ),
      ),
    ),
  );
}

runJs() {
  var qjs = new FlutterQuickjs();
  var res;
  try {
    res = qjs.eval('Math.PI');
  } catch (e) {
    res = e.message;
  }
  qjs.close();
  return res.toString();
}

More usages see example

Todo #

  • bytecode support
  • support more platforms like macos,linux

Reference #

Lincense #

MIT © ZhangPingFan

61
likes
0
pub points
0%
popularity

Publisher

verified publisherneverlose.com.cn

Flutter bindings for QuickJS with dart:ffi.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, flutter

More

Packages that depend on flutter_quickjs