CaptainConfig class
Configuration for a Captain widget
provide:
- list of initial pages
- popPage function where you should implement pop logic
- shouldPop function to decide whether to handle pop request
- actions that are callable via a dynamic key object and individually modify the page stack and make the navigator rebuild -> return a List
- Mixed in types
Constructors
-
CaptainConfig(List<
Page> _pages, {bool? popPage(Route, dynamic, List<Page> )?, Future<bool> ? shouldPop(List<Page> pages)?, Map<dynamic, List< ? actions, Future<Page> Function(List<Page> pages)>Page> parseRouteInformation(RouteInformation routeInformation, List<Page> pages)?, RouteInformation? initialRouteInformation, RouteInformation restoreRouteInformation(Page page)?, List<void Function(List< ? observers, CaptainRouteParser? routeParser})Page> pages)>
Properties
-
actions
→ Map<
dynamic, List< ?Page> Function(List<Page> pages)> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialRouteInformation → RouteInformation?
-
final
-
navigator navigatorKey
final
-
observers
→ List<
void Function(List< ?Page> pages)> -
final
-
pages
→ List<
Page> -
exposes the list pages that are built by the navigator (unmodifiable)
no setter
-
parseRouteInformation
→ (Future<
Page> Function(RouteInformation routeInformation, List<Page> pages)?) -
final
-
popPage
→ (bool? Function(Route, dynamic, List<
Page> )?) -
final
- restoreRouteInformation → (RouteInformation Function(Page page)?)
-
final
- routeParser → CaptainRouteParser?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shouldPop
↔ (Future<
bool> ? Function(List<Page> pages)?) -
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
intialRouteInformationRouterFacing(
) → RouteInformation -
invokeAction(
dynamic actionKey) → void -
invokeActionFunc(
List< Page> actionFunc(List<Page> pages)) → void -
invokeObservers(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
parseRouteInformationRouterFacing(
RouteInformation _routeInformation) → Future< Page> -
pop(
) → void -
popPageRouterFacing(
Route _route, dynamic _result) → bool -
push(
Page _page) → void -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
restoreRouteInformationRouterFacing(
Page _page) → RouteInformation -
shouldPopRouterFacing(
) → Future< bool> -
toString(
) → String -
A string representation of this object.
inherited
-
upsertAction(
List< Page> actionFunc(List<Page> ), dynamic actionKey) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited