flutter_js_context

Last updated:

0 purchases

flutter_js_context Image
flutter_js_context Images
Add to Cart

Description:

flutter js context

This package enhances the interoperability between Dart and flutter_js.
Features #
Use this package to

Track which variables are defined.
Decode evaluated results that the type is assumed as JSON always.
Load JavaScript file properly.

Getting started #
flutter pub add flutter_js_context
copied to clipboard
Usage #
import 'package:flutter_js_context/flutter_js_context.dart';

void main() {
final context = JsContext();

JsRef obj = JsRef.define(context, 'myvar', '1');

// equals 'var myvar[ref.key] = 4;' in JavaScript.
obj.update("4");

// plus the object's value which is 4 and 4 in javascript runtime.
context.evaluate("${obj.toJsCode()} + 4"); // 8

// plus the object's value which is 8 and 4 in dart.
print(obj.value + 4); // 12
}
copied to clipboard
See test for more usage.
#

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.