FormulaFunction class

A function defined by a variable with parameters: its parameters and the formula body that computes its result from them.

Calling it evaluates body with each parameter reading the argument at its position (missing ones are null). Every other path is read from scope: the app's variables. Calls nest up to maxDepth deep, so a runaway recursion ends with null instead of a crash.

Constructors

FormulaFunction(List<String> parameters, String body, FormulaPathResolver scope)
Creates a FormulaFunction.
const

Properties

body → String
The formula, without ${= }.
final
externalPaths → Set<String>
The paths body reads that aren't its parameters: the variables a call depends on.
no setter
hashCode → int
The hash code for this object.
no setterinherited
parameters → List<String>
Names of the parameters, in order.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → FormulaPathResolver
Reads the variables the body uses besides its parameters.
final

Methods

call(List<Object?> arguments) → Object?
The result of the body for arguments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxDepth → const int
The deepest nesting of calls allowed.