ShellValue.fromNext constructor
ShellValue.fromNext({
- required RouteKey key,
- required List<
HyperRoute< tabRoutes,RouteValue> > - required RouteNode<
RouteValue> next,
Implementation
factory ShellValue.fromNext({
required RouteKey key,
required List<HyperRoute> tabRoutes,
required RouteNode next,
}) {
final tabIndex = tabRoutes.indexWhere((e) => e.key == next.key);
return ShellValue(
tabIndex: tabIndex,
key: key,
tabNodes: tabRoutes.map((e) {
if (e.key == next.key) {
return next;
}
return e.createNode();
}).toList(),
);
}