getEntry<T> method

ConfigEntry<T>? getEntry<T>(
  1. String key, {
  2. ConfigScope? scope,
})

Build a ConfigEntry for inspection of a single key.

Implementation

ConfigEntry<T>? getEntry<T>(String key, {ConfigScope? scope}) {
  final effectiveScope = scope ?? _resolveScope(key);
  if (effectiveScope == null) return null;
  final value = _store[effectiveScope]![key];
  if (value == null) return null;
  return ConfigEntry<T>(
    key: key,
    value: value as T,
    scope: effectiveScope,
    source: _sources[effectiveScope]?[key] ?? ConfigSource.default_,
  );
}