of<R> static method

NuvigatorPageRoute<R>? of<R>(
  1. BuildContext context
)
override

Returns the closest NuvigatorPageRoute

Implementation

static NuvigatorPageRoute<R>? of<R>(BuildContext context) {
  final route = ModalRoute.of<R>(context);
  if (route is NuvigatorPageRoute) {
    return route as NuvigatorPageRoute<R>?;
  }
  return null;
}