getEnvironmentOrValue method Null safety

dynamic getEnvironmentOrValue(
  1. dynamic value
)

Implementation

static dynamic getEnvironmentOrValue(dynamic value) {
  if (value is String && value.startsWith(r"$")) {
    final envKey = value.substring(1);
    if (!Platform.environment.containsKey(envKey)) {
      return null;
    }

    return Platform.environment[envKey];
  }
  return value;
}