didRemove method
The Navigator removed route.
If only one route is being removed, then the route immediately below
that one, if any, is previousRoute.
If multiple routes are being removed, then the route below the
bottommost route being removed, if any, is previousRoute, and this
method will be called once for each removed route, from the topmost route
to the bottommost route.
Implementation
@override
void didRemove(Route route, Route? previousRoute) {
super.didRemove(route, previousRoute);
final routeName = _extractRouteName(route);
final currentRoute = _RouteData.ofRoute(route);
final previousRouteName = _extractRouteName(previousRoute);
// Log route removal information
Get.log("REMOVING ROUTE $routeName");
Get.log("PREVIOUS ROUTE $previousRouteName");
// Update routing information
_routeSend?.update((value) {
value.route = previousRoute;
value.isBack = false;
value.removed = routeName ?? "";
value.previous = previousRouteName ?? '';
// Reset bottom sheet and dialog flags if needed
value.isBottomSheet =
currentRoute.isBottomSheet ? false : value.isBottomSheet;
value.isDialog = currentRoute.isDialog ? false : value.isDialog;
});
// Report route disposal for specific route types
switch (route) {
case GetPageRoute() || MaterialPageRoute() || CupertinoPageRoute():
RouterReportManager.instance.reportRouteWillDispose(route);
default:
// No reporting needed
break;
}
routing?.call(_routeSend);
}