2020-08-20 00:35:14 +08:00
2020-08-19 00:43:19 +08:00
2020-08-20 00:35:14 +08:00
2020-08-18 08:28:07 +08:00
2020-08-20 00:35:14 +08:00
2020-08-18 23:43:19 +08:00
2020-08-19 00:43:19 +08:00
2020-08-08 18:00:21 +08:00
2020-08-19 00:43:19 +08:00
2020-08-18 08:28:07 +08:00
2020-08-13 13:51:11 +08:00
2020-08-08 18:00:21 +08:00
2020-08-08 18:00:21 +08:00
2020-08-12 23:24:01 +08:00
2020-08-15 14:52:53 +08:00
2020-08-08 18:00:21 +08:00
2020-08-15 19:39:08 +08:00
2020-08-20 00:35:14 +08:00

flutter_qjs

A quickjs engine for flutter.

Feature

This plugin is a simple js engine for flutter used quickjs project.

Each FlutterJs object create a new thread that running a simple js loop. A global async function dart is presented to invoke dart function, and Promise is supported in evaluating js script so that you can use await or then to get external result from dart.

Data convertion between dart and js are implemented as follow:

dart js
Bool boolean
Int number
Double number
String string
Uint8List/Int32List/Int64List ArrayBuffer
Float64List number[]
List Array
Map Object
Closure(List) => Future function(....args)

notice:

  1. All the Uint8List/Int32List/Int64List sent from dart will be converted to ArrayBuffer without marked the size of elements, and the ArrayBuffer will be converted to Uint8List.

  2. function can only sent from js to dart and all the arguments will be packed in a dart List object.

Getting Started

  1. Creat a FlutterJs object. Makes sure call close to release memory when not need it.

  2. Call setMethodHandler to maintain dart function.

  3. Use evaluate to evaluate js script. Makes sure surrounding try-cacth to capture evaluating error.

this contains a fully use of this plugin.

notice: To use this plugin in Linux desktop application, you must change cxx_std_14 to cxx_std_17 in your project's CMakeLists.txt.

Description
A quickjs engine for flutter.
Readme MIT 3 MiB
Languages
C 95%
Dart 2.5%
C++ 1.3%
CMake 0.8%
Ruby 0.2%