RootHyperController constructor
RootHyperController({
- required RouteValue initialRoute,
- required RouteValue? redirect(
- BuildContext context,
- RedirectState state
- required Map<
Object, HyperRoute< routeMap,RouteValue> >
Implementation
RootHyperController({
required RouteValue initialRoute,
required RouteValue? Function(BuildContext context, RedirectState state)
redirect,
required this.routeMap,
}) {
_redirect = (stack) {
if (_redirectContext case final context?) {
if (redirect(context, RedirectState(stack: stack)) case final target?) {
return createStack(target);
}
}
return stack;
};
_stack = createStack(initialRoute);
}