SimpleNavigatorTabRoute constructor

SimpleNavigatorTabRoute({
  1. required String path,
  2. required WidgetTabBuilder builder,
  3. WidgetBuilder? guardLoadingBuilder,
  4. List<String> tabs = const [],
  5. RouteGuardFunc? guard,
})

Implementation

SimpleNavigatorTabRoute({
  required super.path,
  required WidgetTabBuilder builder,
  super.guardLoadingBuilder,
  this.tabs = const [],
  super.guard,
}) : super(
        builder: (context) {
          return builder(
            context,
            SimpleNavigatorTabsWidget(
              tabs: tabs,
              path: path,
            ),
          );
        },
      ) {
  Toolkit.assrt(
    () => tabs.isEmpty || tabs.length > 1,
    "The list of tabs must be greater than or equal to 2.",
  );
  for (var tab in tabs) {
    Toolkit.assrt(
      () => tab.contains("/") && tab.split("/").length <= 2,
      "Tab path is invalid. Tab path must be '/<tab-path>' as in the examples '/feed-tab' or '/feed'",
    );
  }
}