Sailor class

Sailor manages routing, registering routes with transitions, navigating to routes, closing routes. It is a thin layer on top of Navigator to help you encapsulate and manage routing at one place.

Constructors

Sailor({SailorOptions options = const SailorOptions(isLoggingEnabled: true)})

Properties

hashCode int
The hash code for this object.
read-onlyinherited
read-only
read-only
options SailorOptions
Configuration options for Sailor.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

addRoute(SailorRoute route) → void
Add a new route to Sailor.
addRoutes(List<SailorRoute> routes) → void
Add a list of routes at once.
call<T>(String name, {BaseArguments args, NavigationType navigationType = NavigationType.push, dynamic result, bool removeUntilPredicate(Route route), List<SailorTransition> transitions, Duration transitionDuration, Map<String, dynamic> params, CustomSailorTransition customTransition}) Future<T>
Makes this a callable class. Delegates to navigate.
generator() RouteFactory
Generates the RouteFactory which builds a Route on request.
getRegisteredRouteNames() List<String>
Get the registered routes names as a list.
Function used to navigate pages.
Push multiple routes at the same time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
pop([dynamic result]) → void
Delegation for Navigator.pop.
popUntil(void predicate(Route)) → void
Delegation for Navigator.popUntil.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

args<T extends BaseArguments>(BuildContext context) → T
Retrieves the arguments passed in when calling the navigate function.
param<T>(BuildContext context, String key) → T
unknownRouteGenerator() RouteFactory