getOr method

String getOr(
  1. String name, {
  2. required String fallback,
})

Gets a value by name from the underlying config map, or the fallback if the underlying map does not contain the name.

Implementation

String getOr(String name, {required String fallback}) {
  if (!_env.containsKey(name) &&
      !_augments.values.any((m) => m.containsKey(name))) {
    return fallback;
  }
  return _env[name] ??
      _augments.values.firstWhere((m) => m.containsKey(name))[name]!;
}