StateExtension<X extends StatefulWidget> extension

Extension for State to access Data and Model widgets.

on

Methods

changeModel<T>(Symbol key, T value) → void

Available on State<X>, provided by the StateExtension extension

Change the data of the model with the given key. Throws an assertion error if the model is read-only.
find<T>() → T

Available on State<X>, provided by the StateExtension extension

Find the data of the given type from the context. Does not listen to the data changes.
findMessenger<T>() → T

Available on State<X>, provided by the StateExtension extension

Find the stored data somewhere in the ancestor DataMessenger descendants. Throws an assertion error if the data is not found.
findModel<T>(Symbol key) → T

Available on State<X>, provided by the StateExtension extension

Find the data of the given type from the context. Throws an assertion error if the data is not found.
findProperty<T>(Symbol key) ModelProperty<T>

Available on State<X>, provided by the StateExtension extension

Find the property of the given type from the context. Throws an assertion error if the data is not found.
findRoot<T>() → T

Available on State<X>, provided by the StateExtension extension

Find the root data of the given type from the context. Throws an assertion error if the data is not found.
maybeChangeModel<T>(Symbol key, T value) → void

Available on State<X>, provided by the StateExtension extension

Optionally change the data of the model with the given key. Ignores if the model is read-only.
maybeFind<T>() → T?

Available on State<X>, provided by the StateExtension extension

Optionally find the data of the given type from the context.
maybeFindMessenger<T>() → T?

Available on State<X>, provided by the StateExtension extension

Find the DataMessenger that holds all of the data with the given type from the context.
maybeFindModel<T>(Symbol key) → T?

Available on State<X>, provided by the StateExtension extension

Optionally find the data of the given type from the context. Returns null if the data is not found.
maybeFindProperty<T>(Symbol key) ModelProperty<T>?

Available on State<X>, provided by the StateExtension extension

Optionally find the property of the given type from the context. Returns null if the data is not found.
maybeFindRoot<T>() → T?

Available on State<X>, provided by the StateExtension extension

Optionally find the root data of the given type from the context.
maybeModel<T>(Symbol key) → T?

Available on State<X>, provided by the StateExtension extension

Optionally find the data of the given type from the context. Returns null if the data is not found.
maybeOf<T>() → T?

Available on State<X>, provided by the StateExtension extension

Optionally find and listen to data changes of the data with the given type from the context.
maybeProperty<T>(Symbol key) ModelProperty<T>?

Available on State<X>, provided by the StateExtension extension

Optionally find and listen to property changes of the data with the given type from the context. Returns null if the data is not found.
model<T>(Symbol key) → T

Available on State<X>, provided by the StateExtension extension

Find the data of the given type from the context. Throws an assertion error if the data is not found.
of<T>() → T

Available on State<X>, provided by the StateExtension extension

Find and listen to data changes of the data with the given type from the context.
property<T>(Symbol key) ModelProperty<T>

Available on State<X>, provided by the StateExtension extension

Find and listen to property changes of the data with the given type from the context. Throws an assertion error if the data is not found.