removeRoute method
Remove the nearest page in context
, if it exists. Do nothing if it doesn't exist.
Implementation
void removeRoute(BuildContext context) {
assert(routerDelegate is StandardRouterDelegate);
final tDelegate = routerDelegate as StandardRouterDelegate;
final tRoute = ModalRoute.of(context);
if (tRoute == null) {
return;
}
tDelegate.removeRoute(tRoute, null);
}