UiRouter constructor
UiRouter({})
Implementation
factory UiRouter({
// Pages
required List<UiRoute> pages,
// Dialogs
List<UiDialog> dialogs = const [],
// Redirect returns URI
String? Function(UiState state)? redirect,
}) {
final rootShell = UiShell.root(
pages: pages,
);
final theme = themeFromRoute(rootShell) as UiNavShellTheme;
final dialogNotifier = UiDialogNotifier(
dialogs: dialogs,
);
final navShellNotifiers = createAllNavNotifiers(rootShell, redirect);
final tabShellNotifiers = createAllTabNotifiers(rootShell, redirect);
return UiRouter._(
shellPath: rootShell.path,
rootTheme: theme,
navShellNotifiers: navShellNotifiers,
tabShellNotifiers: tabShellNotifiers,
dialogNotifier: dialogNotifier,
);
}