Destination<T extends DestinationParameters> class

A class that contains all required information about navigation target.

The destination is identified by its path. Optionally, parameters can be provided. Either content builder or nested navigator must be provided for the destination.

The navigator uses a destination's settings to determine a way of changing the navigation stack, apply transition animations and other aspects of updating the navigation state.

The parser is used to parse destination from the URI and generate a URI string for the destination.

Optional upwardDestinationBuilder builder function can be used to implement custom logic of upward navigation from the current destination.

If redirections are specified, they will be applied on navigation to this destination.

See also:

Constructors

Destination({required String path, Widget builder(BuildContext context, T? parameters)?, bool isHome = false, NavigationController? navigator, T? parameters, DestinationParser<DestinationParameters> parser = const DefaultDestinationParser(), List<Redirection> redirections = const <Redirection>[], DestinationSettings? settings, String? tag, Future<Destination<DestinationParameters>?> upwardDestinationBuilder(Destination<T> destination)?})
Creates a destination.
Destination.transit({required String path, required NavigationController? navigator, Widget builder(BuildContext context, T? parameters, WidgetBuilder childBuilder)?, bool isHome = false, List<Redirection> redirections = const <Redirection>[], DestinationSettings? settings, String? tag})
Creates a destination that provides a navigator with nested destinations.

Properties

builder → (Widget Function(BuildContext context, T? parameters)?)
A content builder.
final
hashCode int
The hash code for this object.
no setteroverride
isFinalDestination bool
Whether this destination is final, i.e. it builds a content
no setter
isHome bool
Whether the destination is the home destination.
final
A child navigator.
final
parameters → T?
Parameters of the destination.
final
parser DestinationParser<DestinationParameters>
A destination parser.
final
path String
Path identifies the destination.
final
redirections List<Redirection>
Destinations and conditions to redirect.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings DestinationSettings
Defines a way of how this destination will appear.
latefinal
tag String?
An optional label to identify a destination.
final
upwardDestination Future<Destination<DestinationParameters>?>
Return a destination that should be displayed on reverse navigation.
no setter
upwardDestinationBuilder → (Future<Destination<DestinationParameters>?> Function(Destination<T> destination)?)
Function that returns an underlay destination.
final
uri String
A full URI of the destination, with parameters placeholders replaced with actual parameter values.
no setter

Methods

build(BuildContext context) Widget
Return a widget that display destination's content.
copyWith({T? parameters, DestinationSettings? settings, Future<Destination<DestinationParameters>?> upwardDestinationBuilder(Destination<T> destination)?}) Destination<T>
Creates a copy of this destination with the given fields replaced with the new values.
isMatch(String uri) bool
Check if the destination matches the provided URI string
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String uri) Future<Destination<T>>
Parses the destination from the provided URI string.
toString() String
A string representation of this object.
override
withParameters(T parameters) Destination<T>
Returns a copy of this destination with different parameters.
withSettings(DestinationSettings settings) Destination<T>
Returns a copy of this destination with a different settings.

Operators

operator ==(Object other) bool
Destinations are equal when their URI string are equal.
override