getInitialRouteName method

String getInitialRouteName()

Retrieves the initial route name from your router.

Implementation

String getInitialRouteName() {
  List<MapEntry<String, NyRouterRoute>> initialRoutes = NyNavigator
      .instance.router._routeNameMappings.entries
      .where((element) => element.value.getInitialRoute() == true)
      .toList();

  if (initialRoutes.isNotEmpty) {
    return initialRoutes.first.value.name;
  }
  return "/";
}