Redirection class

Defines a redirection.

Uses validator function to determine if it is allowed to navigate to the given destination. If it is not, user will be redirected to either a provided fixed destination, or to a destination returned by resolver function.

You can extend this class and override its validate and resolve methods to implement more complex logic of redirection.

See also:

Constructors

Redirection({Destination<DestinationParameters>? destination, Future<Destination<DestinationParameters>> resolver(Destination<DestinationParameters> destination)?, Future<bool> validator(Destination<DestinationParameters> destination)?})
Creates a redirection.
const

Properties

destination Destination<DestinationParameters>?
Destination to redirect.
final
hashCode int
The hash code for this object.
no setterinherited
resolver → (Future<Destination<DestinationParameters>> Function(Destination<DestinationParameters> destination)?)
Identifies a destination to redirect.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validator → (Future<bool> Function(Destination<DestinationParameters> destination)?)
Validates a destination.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(Destination<DestinationParameters> destination) Future<Destination<DestinationParameters>>
Destination to redirect
toString() String
A string representation of this object.
inherited
validate(Destination<DestinationParameters> destination) Future<bool>
Validates the destination.

Operators

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