RouteControl mixin
Mixin class to enable navigation for ControlWidget
- Superclass Constraints
- Implemented types
Properties
- context → BuildContext?
-
Returns BuildContext of current State if is available.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- holder → ControlArgHolder
-
finalinherited
- isInitialized → bool
-
Returns 'true' if State is hooked and
WidgetControlHolder
is initialized.no setterinherited - isValid → bool
-
Returns 'true' if Widget is active and
WidgetControlHolder
is not disposed. Widget is valid even when is not initialized yet.no setterinherited - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → ControlScope
-
no setterinherited
Methods
-
addArg(
dynamic args) → void -
Adds given
args
to this Widget's internal arg store.args
can be whatever - Map, List, Object, or any primitive.inherited -
backTo<
T> ({Route? route, String? identifier, bool predicate(Route)?, Route? open}) → void -
Goes back in navigation stack until Route found.
override
-
backToRoot(
{Route? open}) → void -
Goes back in navigation stack until first Route.
override
-
close(
[dynamic result]) → bool -
Pops Route from navigation stack.
result is send back to parent.
override
-
closeRoute(
Route route, [dynamic result]) → bool -
Removes given
route
from navigator.override -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
Creates the mutable state for this widget at a given 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
-
dispose(
) → void -
Used to clear and dispose object.
After this method call is object typically unusable and ready for GC.
Can be called multiple times!
inherited
-
getActiveRoute(
) → Route? - Returns currently active Route. Route is typically stored in ControlArgHolder during navigation handling and is passed as argument. If Route is not stored in arguments, closest Route from Navigation Stack is returned.
-
getArg<
T> ({dynamic key, T? defaultValue}) → T? -
Returns value by given
key
and Type from this Widget's internal arg store.inherited -
getContext(
{bool root = false}) → BuildContext? -
Returns BuildContext of this Widget or 'root' context from ControlRootScope.
inherited
-
getScopeControl<
T extends ControlModel?> ({dynamic key, dynamic args}) → T? -
Returns ControlModel by given
T
orkey
from current UI Treeinherited -
init(
Map args) → void -
Init is typically called right after constructor by framework.
args
- Arguments passed from parent or through Factory.override -
initRouteOf<
T> ({dynamic identifier, dynamic args}) → Route? - Initializes and returns Route via RouteStore and RouteControl.
-
mount<
T> ({dynamic key, T init()?, bool stateNotifier = false}) → T? -
Returns value by given
key
and Type from this Widget's internal arg store. If object is not found, then widget willinit
and store it to args. Object is also registered for dispose.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyState(
) → void -
inherited
-
onDependencyChanged(
) → void -
Called whenever dependency of Widget is changed.
Check State.didChangeDependencies for more info.
inherited
-
onInit(
Map args) → void -
inherited
-
onStateUpdate(
CoreWidget oldWidget, CoreState< CoreWidget> state) → void -
Executed when State is changed and new
state
is available. Widget will try to resurrect State and injects args from 'cache' in holder.inherited -
onUpdate(
CoreWidget oldWidget) → void -
Called whenever Widget needs update.
Check State.didUpdateWidget for more info.
inherited
-
openDialog(
WidgetBuilder builder, {bool root = true, dynamic type}) → Future -
Opens specific dialog based on given
type
Be default opens simple pop-up dialog.override -
openRoot(
Route route) → Future -
Clears current Navigator and opens new Route.
override
-
openRoute(
Route route, {bool root = false, bool replacement = false}) → Future -
Pushes route into current Navigator.
route
- specific route: type, settings, transition etc.root
- pushes route into root Navigator - onto top of everything.replacement
- pushes route as replacement of current route.override -
register(
Disposable? object) → void -
Registers object to lifecycle of State.
inherited
-
registerStateNotifier(
dynamic object) → void -
inherited
-
removeArg<
T> ({dynamic key}) → void -
Removes given
arg
from this Widget's internal arg store.inherited -
routeOf<
T> ([dynamic identifier]) → RouteHandler? -
setArg<
T> ({dynamic key, required dynamic value}) → void -
Adds given
args
to this Widget's internal arg store.args
can be whatever - Map, List, Object, or any primitive.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
-
unregister(
Disposable? object) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
- Returns RouteNavigator of closest ControlState that belongs to ControlWidget / SingleControlWidget / BaseControlWidget with RouteControl mixin.
-
findRouteOf<
T> (BuildContext context, [dynamic identifier]) → RouteHandler? - Returns RouteHandler for given Route of closest ControlState that belongs to ControlWidget / SingleControlWidget / BaseControlWidget with RouteControl mixin.