digia_expr 0.0.15
digia_expr: ^0.0.15 copied to clipboard
A powerful and flexible expression evaluator for Dart, designed to dynamically process expressions with support for variables, custom functions, and string interpolation. This package is developed for [...]
example/digia_expr_example.dart
import 'package:digia_expr/digia_expr.dart';
void main() {
// final code = "'Hello World \${sum(mul(x,4),y)}!'";
final code = "condition(condition(true, false, true), 'Hey', 'Hello')";
final context = BasicExprContext(variables: {'x': 10, 'y': 2});
final result = Expression.eval(code, context);
print('---------ASTEvaluator----------');
print(result);
}