MapValueScope class
A ValueScope over a map of named values: the app's data, a screen's
variables and route params. Paths read into maps and lists
(user.name, items[0].price, items.0); a name this scope doesn't
hold is read from parent.
- Inheritance
-
- Object
- ChangeNotifier
- MapValueScope
- Implemented types
Constructors
-
MapValueScope({Map<
String, Object?> values = const {}, ValueScope? parent})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- parent → ValueScope?
-
The enclosing scope.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
→ Map<
String, Object?> -
The values this scope holds (not its parent's).
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
declares(
String name) → bool -
Whether this scope holds
name. -
dispose(
) → void -
Discards any resources used by the object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
read(
String path) → Object? -
The value at
path(user.name,item.price), or null.override -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
scopeOf(
String name) → MapValueScope? -
The scope (this or an ancestor) holding
name, or null. -
set(
String name, Object? value) → void -
Sets
namehere and notifies, when it changes. -
setAll(
Map< String, Object?> values) → void - Sets several values at once (one notification).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
pathSegments(
String path) → List< String> -
a.b[0].c→[a, b, 0, c].