pop method

void pop({
  1. Map<String, String> pathParameters = const {},
  2. Map<String, String> queryParameters = const {},
  3. String? hash,
  4. Map<String, String> newHistoryState = const {},
})
override

Prevent the current redirection and call pop instead

See VRouter.pop for more information on push

Implementation

void pop({
  Map<String, String> pathParameters = const {},
  Map<String, String> queryParameters = const {},
  String? hash,
  Map<String, String> newHistoryState = const {},
}) {
  stopRedirection();
  _redirectFunction = ({
    required VRouterDelegate vRouterDelegate,
    required VRouteElementNode vRouteElementNode,
  }) =>
      vRouterDelegate.navigatorKey.currentState!.pop(
        VPopData(
          elementToPop: vRouteElementNode.getVRouteElementToPop(),
          pathParameters: {
            ...pathParameters,
            ...vRouterDelegate
                .pathParameters, // Include the previous path parameters when popping
          },
          queryParameters: queryParameters,
          hash: hash,
          newHistoryState: newHistoryState,
        ),
      );
}