NavigatorStackControl class
Controller for: NavigatorStack.group - Multiple NavigatorStacks in Stack. Only selected Controllers are visible - Offstage. Typically just one page is visible - usable with BottomNavigationBar to preserve navigation of separated pages. NavigatorStack.menu - Simplified version of NavigatorStack.group, can be used if access to NavigatorControls is not required.
- Inheritance
-
- Object
- ControlModel
- BaseControl
- NavigatorStackControl
- Mixed in types
- Available Extensions
Constructors
Properties
- currentControl → NavigatorControl?
-
Returns current controller - based on currentPageIndex.
no setter
- currentMenu → NavItem?
-
no setter
- currentPageIndex → int
-
Returns current page index.
Use setPageIndex to change active controller.
Use pageIndex to be notified about changes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- internalData ↔ dynamic
-
getter/setter pairinherited
- isInitialized → bool
-
Return 'true' if init function was called before.
no setterinherited
- isValid → bool
-
no setter
-
items
→ List<
NavigatorControl> -
List of Controllers set in Widget construct phase.
no setter
-
List of MenuItems set in Widget construct phase.
no setter
- onPagesInitialized ↔ VoidCallback?
-
getter/setter pair
-
pageIndex
→ ObservableValue<
int?> -
Subscription to listen about page index changes.
no setter
- preferSoftDispose ↔ bool
-
requestDispose will execute softDispose. Useful for items in list and objects store in ControlFactory. Final dispose must be handled manually.
getter/setter pairinherited
- preventDispose ↔ bool
-
requestDispose do nothing if set. Final dispose must be handled manually.
getter/setter pairinherited
- preventMultiInit ↔ bool
-
Prevents multiple initialization and onInit will be called just once.
getter/setter pairinherited
- reloadOnReselect ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ dynamic
-
getter/setter pairinherited
Methods
-
cancel(
ControlSubscription subscription) → void -
inherited
-
cast<
U> () → ObservableValue< U> -
inherited
-
clear(
) → void -
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!
override
-
getControl(
{int? index, NavItem? item, dynamic key}) → NavigatorControl? -
init(
Map args) → void -
Init is typically called right after constructor by framework.
args
- Arguments passed from parent or through Factory. Set preventMultiInit to enable multi init / re-initinherited -
initControls(
List< NavigatorControl> controls) → void -
invalidate(
) → void -
Invalidates Control and sets isInitialized to false.
inherited
-
Navigates back withing active NavigatorStack or sets page index to 0.
Returns
true
if navigation is handled by Controller. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
inherited
-
onInit(
Map args) → void -
Is typically called once and shortly after constructor.
In most of times Widget or State isn't ready yet.
preventMultiInit is enabled by default and prevents multiple calls of this function.
args
input arguments passed from parent or Factory.inherited -
popScope(
) → Future< bool> - Helper function for WillPopScope. Returns negation of navigateBack as Future.
-
register(
dynamic object) → void -
Used to register interface/handler/notifier etc.
Can be called multiple times with different objects!
inherited
-
reload(
) → Future< void> -
Reload model and data.
inherited
-
requestDispose(
[dynamic parent]) → void -
Executes dispose based on preventDispose and preferSoftDispose settings.
parent
- actual object that requesting dispose.inherited -
setInitialPage(
) → void -
setPageByItem(
NavItem item) → void -
setPageByKey(
dynamic key) → void -
setPageIndex(
int index) → void -
Sets page index and notifies pageIndex
Given index is clamped between valid indexes
items.length
Notifies State to switch Pages. -
setValue(
dynamic value, {bool notify = true, bool forceNotify = false}) → void -
inherited
-
softDispose(
) → void -
Just soft dispose - stop loading / subscriptions etc.
For example called when List item hides and is recycled.
Also useful when Control is used with multiple Widgets to prevent fatal dispose.
override
-
subscribe(
ValueCallback action, {bool current = true, dynamic args}) → ControlSubscription -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited