Environment constructor
Environment([])
Constructs a new Environment instance with the provided initial data.
The Environment class manages the variable stack and filters used within a
code context. This constructor initializes the variable stack with the given
data
map, which represents the initial variables and their values.
Parameters:
data
: An optional map of initial variables and their values. Defaults to an empty map.register
: An optional map of initial register values. Defaults to an empty map.strictMode
: When true, only locally registered filters and tags are accessible. Defaults to false.
Implementation
Environment(
[Map<String, dynamic> data = const {},
Map<String, dynamic>? register,
bool strictMode = false])
: _variableStack = [data],
_registers = register ?? {},
_strictMode = strictMode;