expectUIRoutes function

void expectUIRoutes(
  1. List<String> routes, {
  2. String? reason,
  3. dynamic skip,
})

Expects routeName at UINavigator.currentRoute.

Implementation

void expectUIRoutes(List<String> routes, {String? reason, skip}) {
  if (routes.isEmpty) {
    throw ArgumentError("Empty `routes`");
  }

  var currentRoute = UINavigator.currentRoute ?? '';

  expect(routes.contains(currentRoute), isTrue,
      reason: reason ?? 'Expected one of routes: $routes', skip: skip);
}