config<T> method

T config<T>(
  1. String path, {
  2. T? defaultValue,
})

Fetches a configuration value from ConfigService.

Implementation

T config<T>(String path, {T? defaultValue}) {
  final relative = ConfigPath(path);
  final absolute = configPath?.join(relative) ?? relative;
  return resolve<ConfigService>()
      .fetch<T>(absolute, defaultValue: defaultValue);
}