conf library

Classes

CombiningSource
A ConfigurationSource that is a combination of other ConfigurationSources.
CommandLineSource
A ConfigurationSource that reads configuration values from a list of command-line arguments.
ConfBoolean
A ConfScalar that loads a bool value.
ConfDateTime
A ConfScalar that loads a DateTime value.
ConfDefault<T>
A ConfigurationSchemaNode that loads a configuration value if it exists, or a defaultValue if it doesn't.
ConfDouble
A ConfScalar that loads a double value.
ConfEnum<T extends Enum>
A ConfScalar that loads an Enum value.
ConfigurationError
A configuration error occurs when configuration is invalid.
ConfigurationKey
A key for which a ConfigurationSource might have a value.
ConfigurationSchemaNode<T>
A node in a configuration schema.
ConfigurationSource
A source of configuration values.
ConfInteger
A ConfScalar that loads an int value.
ConfInternetAddress
A ConfScalar that loads an InternetAddress value.
ConfList<T>
A ConfigurationSchemaNode that loads a list of configuration values.
ConfNullable<T>
A ConfigurationSchemaNode that loads a configuration value if it exists, or null if it doesn't.
ConfNumber
A ConfScalar that loads a num value.
ConfObject<T>
A ConfigurationSchemaNode that loads a configuration value by composing multiple configuration values into a single object.
ConfProfiles<T extends Enum>
A ConfScalar that loads a Profiles object.
ConfProperty<T>
A ConfigurationSchemaNode that loads the configuration value for the property of a ConfObject.
ConfRebase<T>
A ConfigurationSchemaNode that loads a configuration value from a key that is calculated by appending a base key to the key that is passed to load.
ConfScalar<T>
A ConfigurationSchemaNode that loads a single value from it's string representation.
ConfString
A ConfScalar that loads a String value.
ConfUri
A ConfScalar that loads a Uri value.
DataSource
A ConfigurationSource that reads configuration values from a nested structure of maps and lists.
EnvironmentSource
A ConfigurationSource that reads configuration values from a map of environment variables such as Platform.environment.
ParseConfScalar<T>
A ConfScalar that loads a value from a string representation, if the value is not already of the correct type.
ParseFunctionConfScalar<T>
A ParseConfScalar that uses a function to parse values.
Profiles<T extends Enum>
A set of configuration profiles.
RootSchemaNode<T>
A configuration schema node that can load a value from a ConfigurationSource without requiring a ConfigurationKey.

Extensions

AppSources on CombiningSource
Opinionated loading of configuration sources for a Dart applications, such as servers.
JsonConfExtension on ConfigurationSource
Extension for reading a ConfigurationSource from a JSON string stored in another ConfigurationSource.
LoadProfilesExtension on ConfigurationSource
An extension for loading and activating a set of Profiles from a ConfigurationSource.

Functions

loadConfigurationFile(String filePath) Future<DataSource>
Loads a configuration file and returns a ConfigurationSource containing the parsed data.
loadConfigurationFiles({required String directory, required String configName, List<String>? variants}) Future<List<ConfigurationSource>>
Loads a set of configuration files and returns a list of DataSources containing the loaded configuration values.
loadJsonConfigurationFile(String filePath) Future<DataSource>
Loads a JSON configuration file and returns a DataSource containing the parsed JSON data.
loadYamlConfigurationFile(String filePath) Future<DataSource>
Loads a YAML configuration file and returns a DataSource containing the parsed YAML data.
profilesProperty<T extends Enum>({required List<T> allProfiles, Set<T> defaultProfiles = const {}}) ConfProperty<Profiles<T>>
A ConfProperty that loads a Profiles object from the "profiles" configuration value.

Typedefs

ConfObjectFactory<T> = T Function(Map<String, Object?> properties)
A function that creates the value of a ConfObject from a map of property names to configuration values.

Exceptions / Errors

ConfigurationException
An exception that is thrown when configuration is invalid.