addVariable method

void addVariable(
  1. String scope,
  2. String name,
  3. dynamic value
)

Add variable to specific scope

Implementation

void addVariable(String scope, String name, dynamic value) {
  _context['scopes'] ??= <String, dynamic>{};
  final scopes = _context['scopes'] as Map<String, dynamic>;
  scopes[scope] ??= <String, dynamic>{};
  final scopeData = scopes[scope] as Map<String, dynamic>;
  scopeData[name] = value;
}