SimpleNavigatorTabRoute constructor
SimpleNavigatorTabRoute({
- required String path,
- required WidgetTabBuilder builder,
- WidgetBuilder? guardLoadingBuilder,
- List<
String> tabs = const [], - 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'",
);
}
}