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
.constfactory
Properties
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 ConfigT
& id of configO
. -
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 givenname
has a matchingid
with its Config.id. -
put(
{String name = 'default', required ConfigCreationCallback< Config< create}) → voidObject> > -
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 itsname
. -
setIfAbsent(
{String name = 'default', required ConfigCreationCallback< Config< create}) → voidObject> > -
Adds a Config to the store by its
name
if it does not already exist.