declareVariable method

void declareVariable(
  1. DartBlockDataType dataType,
  2. String name,
  3. DartBlockValue? value
)

Used by VariableDeclarationStatement to declare a new variable with an optional initial value, i.e., its initial value can be null.

Implementation

void declareVariable(
  DartBlockDataType dataType,
  String name,
  DartBlockValue? value,
) {
  final currentEnvironment = _getCurrentEnvironment();
  currentEnvironment.declareVariable(this, name, dataType, value);
}