BasePageConnector<PageState extends BasePageState<BaseUIModel>, PageView extends BasePageView> class

Pairs the Page to its State

Inheritance

Constructors

BasePageConnector({required BasePageState<BaseUIModel> state, required PageView? page, required PageView getPage(PageState)})
Creates a BasePageConnector to pair up a state object of type BasePageState with a page of type BasePageView

Properties

builder ViewModelBuilder<PageState>
Build a Widget using the BuildContext and Model. The Model is created by the vm or converter functions.
finalinherited
converter StoreConverter<AppState, PageState>?
Convert the Store into a Model. The resulting Model will be passed to the builder function.
finalinherited
debug Object?
Pass the parameter debug: this to get a more detailed error message.
finalinherited
distinct bool?
When distinct is true (the default), the Widget is rebuilt only when the Model changes. In order for this to work correctly, you must implement == and hashCode for the Model.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
model BaseModel?
Don't use, this is deprecated. Please, use the recommended vm parameter (of type VmFactory) or converter.
finalinherited
onDidChange OnDidChangeCallback<AppState, PageState>?
A function that will be run on State change, after the Widget is built. This function is passed the Model, and if distinct is true, it will only be called if the Model changes. This can be useful for running certain animations after the build is complete. Note: Using a BuildContext inside this callback can cause problems if the callback performs navigation. For navigation purposes, please use onWillChange.
finalinherited
onDispose OnDisposeCallback<AppState>?
A function that will be run when the StoreConnector is removed from the Widget Tree. It is run in the State.dispose method. This can be useful for dispatching actions that remove stale data from your State tree.
finalinherited
onInit OnInitCallback<AppState>?
A function that will be run when the StoreConnector is initially created. It is run in the State.initState method. This can be useful for dispatching actions that fetch data for your Widget when it is first displayed.
finalinherited
onInitialBuild OnInitialBuildCallback<AppState, PageState>?
A function that will be run after the Widget is built the first time. This function is passed the store and the initial Model created by the vm or the converter function. This can be useful for starting certain animations, such as showing snackbars, after the Widget is built the first time.
finalinherited
onWillChange OnWillChangeCallback<AppState, PageState>?
A function that will be run on State change, before the Widget is built. This function is passed the Model, and if distinct is true, it will only be called if the Model changes. This can be useful for imperative calls to things like Navigator, TabController, etc
finalinherited
page → PageView?
A reference to an instance of the page for easy access to its BasePageSpecs
final
rebuildOnChange bool
Determines whether the Widget should be rebuilt when the Store emits an onChange event.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldUpdateModel ShouldUpdateModel<AppState>?
A test of whether or not your vm or converter function should run in response to a State change. For advanced use only. Some changes to the State of your application will mean your vm or converter function can't produce a useful Model. In these cases, such as when performing exit animations on data that has been removed from your Store, it can be best to ignore the State change while your animation completes. To ignore a change, provide a function that returns true or false. If the returned value is true, the change will be applied. If the returned value is false, the change will be ignored. If you ignore a change, and the framework needs to rebuild the Widget, the builder function will be called with the latest Model produced by your vm or converter function.
finalinherited
vm → (VmFactory<AppState, dynamic, dynamic> Function()?)
Convert the Store into a Model. The resulting Model will be passed to the builder function.
finalinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
getLatestModel(Store store) → PageState
This is not used directly by the store, but may be used in tests. If you have a store and a StoreConnector, and you want its associated ViewModel, you can do: Model viewModel = storeConnector.getLatestModel(store);
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited