hasRouteConstant static method

bool hasRouteConstant(
  1. String c,
  2. String routeName
)

Implementation

static bool hasRouteConstant(String c, String routeName) {
  String escapedRouteName = RegExp.escape(routeName);
  final String pattern =
      "static String \\w+ = ['\"]/?$escapedRouteName['\"];";

  final RegExp routePattern = RegExp(pattern);

  return routePattern.hasMatch(c);
}