asserts method

void asserts(
  1. List<RouteBase> routes
)

Implementation

void asserts(List<RouteBase> routes) {
  assert(() {
    for (var r in routes) {
      if (r is GoRoute && r.path == LoginPage.path) return false;
    }
    return true;
  }(), "the path ${LoginPage.path} are reserved");
  assert(() {
    for (var r in routes) {
      if (r is GoRoute && r.path == ServerSettingsPage.path) return false;
    }
    return true;
  }(), "the path ${ServerSettingsPage.path} are reserved");
  assert(() {
    var homefound = false;
    for (var r in routes) {
      if (r is GoRoute && r.path == "/home") homefound = true;
    }
    return homefound;
  }(), "the /home path is requiered");
}