flutter_jscore
javascriptcore for flutter. the plugin provides the ability to evaluate javascript programs from within dart.
getting started
add dependency
// pub
dependencies:
flutter_jscore: ^last_version
// import
dependencies:
flutter_jscore:
path: your local path
// git
dependencies:
flutter_jscore:
git:
url: git://github.com/xuelongqy/flutter_jscore.git
super simple to use
import 'package:flutter_jscore/flutter_jscore.dart';
void runjs() {
jscontext jscontext = jscontext.createingroup();
// replace '1 + 1' with your javascript code
jsvalue jsvalue = jscontext.evaluate('1 + 1');
print(jsvalue.string);
jscontext.release();
}
javascriptcore
evaluate javascript programs from within an app, and support javascript scripting of your app.
dart:ffi
foreign function interface for interoperability with the c programming language. flutter_jscore uses dart:ffi so you don’t have to worry about performance loss across programming languages.
supported platforms
- ios (7.0+)
- macos (10.5+)
- android (arm32, arm64, x86, x86_64)
- windows (x86_64)
- linux (x86_64)
linux dependencies
if you use it on linux, you must make sure to have the following dependencies.
- libglib-2.0.so.0
- libicui18n.so.66
- libicuuc.so.66
- libdl.so.2
- libgio-2.0.so.0
- libgobject-2.0.so.0
- libpthread.so.0
- libstdc++.so.6
- libm.so.6
- libgcc_s.so.1
- libc.so.6
- ld-linux-x86-64.so.2
Comments are closed.