Config<T extends Object> class abstract

A representation of a configuration that can be identified by an id.

This configuration is stored in a ConfigStore and can be retrieved by a name.

Implementers

Constructors

Config()
const
Config.fromMap(T id, Map<String, dynamic> data)
Creates a configuration from a map that can be identified by an id.
const
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
id → T
The unique identifier of this Config.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

manager ConfigsManager
All configs are managed by a ConfigsManager. It uses a ConfigStore to store and retrieve configs by a name.
getter/setter pair

Static Methods

by<O extends Object, T extends Config<O>>(String name, [ConfigsManager? manager]) ConfigProvider<O, T>
Returns a ConfigProvider which manages the Config only under one name and optionally by type of Config T & id of config O.
get([String name = 'default']) Config<Object>
Returns a config by its name.
isA(Object id, [String name = 'default']) bool
Returns true if the Config stored in the ConfigStore under the given name has a matching id with its Config.id.
put({String name = 'default', required ConfigCreationCallback<Config<Object>> create}) → void
Lazily adds a Config to the store by its name. The config will be created when it is first requested by the get method.
putImmediately({String name = 'default', required Config<Object> config}) Config<Object>
Immediately adds a config to the store by its name.
setIfAbsent({String name = 'default', required ConfigCreationCallback<Config<Object>> create}) → void
Adds a Config to the store by its name if it does not already exist.