ConfigSpec<T> class
abstract
Typed configuration specification for a config namespace.
Specs provide defaults, documentation, and a typed model that can be resolved from user-supplied configuration maps.
- Implementers
Constructors
- ConfigSpec()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- root → String
-
Top-level config namespace (e.g.
cache,session,storage).no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → Schema?
-
The JSON Schema for this configuration.
no setter
Methods
-
defaults(
{ConfigSpecContext? context}) → Map< String, dynamic> - Default values expressed as a map rooted at root.
-
defaultsWithRoot(
{ConfigSpecContext? context}) → Map< String, dynamic> - Default values wrapped in the top-level root key.
-
docs(
{String? pathBase, ConfigSpecContext? context}) → List< ConfigDocEntry> -
Documentation entries for the spec, rooted at
pathBaseor root. -
fromMap(
Map< String, dynamic> map, {ConfigSpecContext? context}) → T - Parse a typed model from a config map scoped to the spec's root.
-
mergeDefaults(
Map< String, dynamic> user, {ConfigSpecContext? context}) → Map<String, dynamic> - Merge defaults with user-provided config, with user values winning.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
Config config, {ConfigSpecContext? context}) → T -
Resolve a typed model from the current
config. -
schemaWithRoot(
) → Map< String, Schema> - Returns the schema wrapped in the root key.
-
toMap(
T value) → Map< String, dynamic> - Convert a typed model into a config map scoped to the spec's root.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited