DesignAdaptiveShell.branches constructor
const
DesignAdaptiveShell.branches({
- Key? key,
- required List<
DesignNavigationDestination> destinations, - required int selectedIndex,
- required ValueChanged<
int> ? onDestinationSelected, - required DesignDestinationBuilder destinationBuilder,
- required List<
WidgetBuilder> branches, - DesignBranchBackBehavior backBehavior = DesignBranchBackBehavior.firstDestination,
- DesignNavigationMode? mode,
- double dampingRatio = 1,
- double stiffness = 700,
A shell whose body is one Navigator per destination, each starting
on its branches root page, built when first shown and kept: each
keeps its own stack. Choosing the selected destination again pops it
to its root. Back (Android's, Escape's route pop) pops the selected
branch, then at its root goes where backBehavior says, then leaves.
DesignAdaptiveShell.branches(destinations: const [DesignNavigationDestination(label: 'Home', icon: IconData(0xe318)), DesignNavigationDestination(label: 'Mail', icon: IconData(0xe158))], selectedIndex: 0, onDestinationSelected: (index) {}, destinationBuilder: (context, destination, details) => Text(destination.label), navigationBuilder: (context, details) => Row(children: details.destinations), branches: [(context) => const Text('Home'), (context) => const Text('Mail')])
Implementation
const DesignAdaptiveShell.branches({
super.key,
required this.destinations,
required this.selectedIndex,
required this.onDestinationSelected,
required this.destinationBuilder,
required this.navigationBuilder,
required List<WidgetBuilder> this.branches,
this.navigatorKeys,
this.backBehavior = DesignBranchBackBehavior.firstDestination,
this.mode,
this.showNavigation = true,
this.dampingRatio = 1,
this.stiffness = 700,
}) : body = null,
assert(dampingRatio > 0 && stiffness > 0);