addVariable<T> method Null safety

void addVariable<T>(
  1. T value,
  2. {String id = ''}
)

Adds variable by type and id

Implementation

void addVariable<T>(T value, {String id = ''}) {
  if (!_variables.containsKey(value.runtimeType)) {
    _variables[value.runtimeType] = {id: value};
  } else {
    _variables[value.runtimeType]![id] = value;
  }
}