routeExists method

bool routeExists(
  1. BuildContext context,
  2. String route
)

Implementation

bool routeExists(BuildContext context, String route) {
  try {
    return GoRouter.of(context)
        .routeInformationParser
        .configuration
        .findMatch(route)
        .matches
        .isNotEmpty;
  } catch (err) {
    return false;
  }
}