JNavigatorService class
A service class that encapsulates navigation functionality in the application.
The JNavigatorService holds a GlobalKey to the NavigatorState,
allowing centralized access to the navigator for performing navigation
actions such as pushing or popping routes.
This service enables decoupling of navigation logic from UI components, making navigation easier to manage and test.
Example usage:
final navigatorService = JNavigatorService(key: GlobalKey<NavigatorState>());
// Navigate to a new route
navigatorService.key.currentState?.pushNamed('/home');
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
key
→ GlobalKey<
NavigatorState> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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