equalsRoute method

bool equalsRoute(
  1. String route
)

Implementation

bool equalsRoute(String route) {
  // get mod path request
  final uriPath = split('/')
      .map(
        (e) => e.replaceFirst(
          // 2b03f6be-c963-4493-8203-7928e195cc12 || 12
          RegExp(r'([a-z\d]+\-[a-z\d]+\-[a-z\d]+\-[a-z\d]+\-[a-z\d]+)|(\d+)'),
          '___',
        ),
      )
      .join('/');

  // path route
  final routePath = route
      .split('/')
      .map(
        (e) => e.replaceFirst(RegExp(r'\{[a-z]+\}'), '___'),
      )
      .join('/');

  return uriPath == routePath;
}