hetu_script 0.3.5+2 hetu_script: ^0.3.5+2 copied to clipboard
Hetu is a lightweight script language for embedding in Flutter apps.
import 'package:hetu_script/hetu_script.dart';
void main() {
var hetu = Hetu();
hetu.init(externalFunctions: {
'hello': () => {'greeting': 'hello'},
});
hetu.eval(r'''
external fun hello
fun main {
var dartValue = hello()
print('dart value:', dartValue)
dartValue['foo'] = 'bar'
return dartValue
}''');
var hetuValue = hetu.invoke('main');
print('hetu value: $hetuValue');
}