RootNavRouter constructor

RootNavRouter([
  1. GoRouter createRouter()?
])

Implementation

factory RootNavRouter([GoRouter Function()? createRouter]) {
  if (_rootRouter == null) {
    if (createRouter != null) {
      _rootRouter = RootNavRouter._(createRouter());
    } else if (_rootRouter == null) {
      // if singleton has not bean created then
      // return a new instance of RootNavRouter
      // that can be used only as a helper for
      // navigating to named routes using a
      // navigator key
      return RootNavRouter._();
    }
  }
  // return the singleton instance
  // of RootNavRouter
  return _rootRouter!;
}