isNearMatch static method
Returns true if path is a near match to the route pattern routePattern.
Used to detect if a route is close to matching, for example when parameters are missing or incomplete.
Implementation
static bool isNearMatch(String routePattern, String path) {
if (!routePattern.contains('/:')) return false;
return routePattern.startsWith(path);
}