routeActive static method

PostFramePredicate routeActive(
  1. BuildContext context
)

Returns a predicate that checks if the current route is still active.

Uses ModalRoute.of to check if the route is current.

Implementation

static PostFramePredicate routeActive(BuildContext context) {
  return () {
    final route = ModalRoute.of(context);
    return route != null && route.isCurrent;
  };
}