ModelKey<T> class
A ModelKey that holds the data key and provides methods to find and change the data.
Properties
Methods
-
change(
BuildContext context, T data) → void - Change the data of the model with the given key. Throws an assertion error if the model is read-only.
-
find(
BuildContext context) → T - Find the data of the given type from the context. Throws an assertion error if the data is not found.
-
findProperty(
BuildContext context) → ModelProperty< T> - Find the data of the given type from the context. Throws an assertion error if the data is not found.
-
maybeChange(
BuildContext context, T data) → void - Optionally change the data of the model with the given key. Ignores if the model is read-only.
-
maybeFind(
BuildContext context) → T? - Optionally find the data of the given type from the context. Returns null if the data is not found.
-
maybeFindProperty(
BuildContext context) → ModelProperty< T> ? - Optionally find the property of the given type from the context. Returns null if the data is not found.
-
maybeOf(
BuildContext context) → T? - Optionally find and listen to data changes of the data with the given type from the context.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
of(
BuildContext context) → T - Find and listen to data changes of the data with the given type from the context.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override