ConditionalNavigationOff class
Conditional navigation class specifically for off() method.
This class is designed for replacement navigation where you want to
pop the current route and push a new one based on a condition.
Unlike ConditionalNavigation, this class only requires pages for the off() method.
Example:
Get.off(
() => HomePage(),
conditionOff: ConditionalNavigationOff(
condition: () => UserService.hasProfile,
truePage: () => DashboardPage(),
falsePage: () => WelcomePage(),
),
);
Constructors
Properties
- condition → dynamic Function()
-
The condition function that returns a boolean to determine which page to navigate to.
final
- falsePage → dynamic Function()
-
The page to navigate to when condition returns false.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- truePage → dynamic Function()
-
The page to navigate to when condition returns true.
final
Methods
-
evaluate(
) → dynamic Function() - Evaluates condition and returns the appropriate page. Returns truePage if condition is true, otherwise falsePage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited