hetu_script 0.4.1+1 hetu_script: ^0.4.1+1 copied to clipboard
Hetu is a lightweight scripting language for embedding in Flutter apps.
import 'package:hetu_script/hetu_script.dart';
void main() {
final hetu = Hetu();
hetu.init(externalFunctions: {
'hello': () => {'greetings': 'greetings from Dart!'},
});
var hetuValue = hetu.eval(r'''
external fun hello
var dartValue = hello()
dartValue['reply'] = 'Hi, this is Hetu.'
dartValue // the script will return the value of it's last expression
''');
print('hetu value: $hetuValue');
}