createPages method
Implementation
@override
Iterable<Page> createPages(BuildContext context) {
final controller = HyperRouter.rootOf(context);
final shellController = ShellController(
value: value,
controller: controller,
);
if (_isShellCovering(next, key)) {
throw HyperError(
"[ShellCoveringNode] can't be a direct child of [ShellRoute]");
}
ShellCoveringNode? coveringNode;
next.next?.forEach((node) {
if (node is ShellCoveringNode && node.shellKey == key) {
coveringNode = node;
}
});
late final RouteNode nextCut;
if (coveringNode case final coveringNode?) {
if (next.cut(coveringNode) case final next?) {
nextCut = next;
}
} else {
nextCut = next;
}
final page = MaterialPage(
child: shellBuilder(
context,
shellController,
Builder(builder: (context) {
return NestedNavigator(
pages: nextCut.createPages(context).toList(),
key: ValueKey(shellController.tabIndex),
);
}),
),
);
return <Page>[page].followedByOptional(coveringNode?.createPages(context));
}