addRouter method Null safety

void addRouter(
  1. {required String path,
  2. required RRouterWidgetBuilder routerWidgetBuilder,
  3. RRouterPageBuilderType? routerPageBuilderType,
  4. PageTransitionsBuilder? routerPageTransitions,
  5. bool? isReplaceRouter}
)

you want to add a widget in the navigation , can use it. path your path routerWidgetBuilder widget builder. routerPageBuilderType page builder transaction type. routerPageTransitions page transitions style. isReplaceRouter you want to replace router when your register.

Implementation

void addRouter(
    {required String path,
    required RRouterWidgetBuilder routerWidgetBuilder,
    RRouterPageBuilderType? routerPageBuilderType,
    PageTransitionsBuilder? routerPageTransitions,
    bool? isReplaceRouter}) {
  if (!_routeMap.containsKey(path) || isReplaceRouter == true) {
    _routeMap[path] = routerWidgetBuilder;
    if (routerPageBuilderType != null) {
      _pageBuilderTypeMap[path] = routerPageBuilderType;
    }
    if (routerPageTransitions != null) {
      _pageTransitionsMap[path] = routerPageTransitions;
    }
  }
}