Overview
FunctionTree is a lightweight Dart library that enables parsing mathematical expressions from strings into executable function trees. It safely evaluates expressions by converting them into structured, callable operations, supporting basic arithmetic, variables, and custom functions. Ideal for dynamic formula evaluation in apps requiring user-defined calculations, such as calculators, scientific tools, or data processing interfaces. The library is platform-agnostic, working across Android, iOS, Web, macOS, Windows, and Linux.
Use cases
- Dynamic formula evaluation
- Calculator applications
- Scientific computation
- Data transformation scripts
- User-defined expression parsing
Key features
- String-to-function tree parsing
- Safe expression evaluation
- Support for variables and custom functions
- Cross-platform compatibility
- Minimal runtime overhead
Suitable for
- Math-heavy app features
- Interactive calculators
- Configurable data processing
- Educational tools
- Backend expression engines
Considerations
- Does not support complex math libraries (e.g., trigonometry) out of the box
- Requires careful input validation to prevent injection risks
- Limited to basic arithmetic without additional setup
- Not optimized for high-frequency repeated evaluations
- No built-in error recovery or detailed diagnostics