replease static method

Future replease(
  1. String path, {
  2. Object? arguments,
  3. TransitionType transitionType = TransitionType.fromRight,
})

replace page Replaces the current route with a new one.

path The route path to navigate to. arguments Optional data to pass to the new route. transitionType Animation type for the transition (defaults to sliding from right).

Returns a Future that completes when the pushed route is popped.

Implementation

static Future<dynamic> replease(
  String path, {
  Object? arguments,
  TransitionType transitionType = TransitionType.fromRight,
}) {
  if (HbRouter.history.isNotEmpty) HbRouter.history.removeLast();
  return Navigator.of(HbRouter.key.currentContext!).pushReplacementNamed(
    path,
    arguments: PageConfig(
      transitionType: transitionType,
      arguments: arguments,
    ),
  );
}