df_config library

A package that provides methods to load configuration data and access it at runtime.

Classes

Config<TConfigRef extends ConfigRef>
A configuration class that maps placeholder strings to values.
ConfigFileRef
A reference to a config file.
ConfigManager<TConfig extends Config<ConfigRef>>
In-memory registry of Config instances, keyed by their ConfigRef.
ConfigRef<TRef, TType>
A reference to a config element.
FileConfig
FileConfigManager
A ConfigManager specialised for FileConfig instances.
PatternSettings
How df_config recognises a placeholder in a string.
PrimaryPatternSettings
Deprecated alias for PatternSettings.primary.
SecondaryPatternSettings
Deprecated alias for PatternSettings.secondary.
TranslationFileReader
Convenience for loading translation files from disk or asset bundles.
TranslationManager
Process-wide owner of the active translation FileConfig that String.tr() looks up against.

Enums

ConfigFileType
The supported config file types.

Constants

kTranslationVersionSeparator → const String
Separates a translation key from the source-text version hash in a versioned storage key, e.g. welcome_key@@a1b2c3d4e5f60718.

Functions

translationSourceHash(String source) String
A short, stable, platform-independent hash of source, rendered as 16 hex characters.
versionedTranslationKey(String key, String source) String
Builds a content-addressed storage key for a translation entry: the plain key suffixed with a short, stable hash of its English source text.

Typedefs

TFileReaderFunction = Future<String> Function(String filePath)
TranslationErrorSink = void Function(String source, Object error, StackTrace stack)
Signature of the TranslationManager.onError sink.

Exceptions / Errors

ConfigParseException
Thrown when a configuration source cannot be parsed into a key-value map.