getVariable method

dynamic getVariable(
  1. String? key,
  2. dynamic defaultValue
)

Get a variable by key, returning a default value if not found

Implementation

dynamic getVariable(String? key, dynamic defaultValue) {
  for (var variable in variables) {
    if (variable.key == key) {
      return variable.value;
    }
  }
  return defaultValue;
}