NavigationBar constructor
- Key? key,
- Duration? animationDuration,
- int selectedIndex = 0,
- required List<
Widget> destinations, - ValueChanged<
int> ? onDestinationSelected, - Color? backgroundColor,
- double? elevation,
- Color? shadowColor,
- Color? surfaceTintColor,
- Color? indicatorColor,
- ShapeBorder? indicatorShape,
- double? height,
- NavigationDestinationLabelBehavior? labelBehavior,
- MaterialStateProperty<
Color?> ? overlayColor,
Creates a Material 3 Navigation Bar component.
The value of destinations
must be a list of two or more
NavigationDestination values.
Implementation
// TODO(goderbauer): This class cannot be const constructed, https://github.com/dart-lang/linter/issues/3366.
// ignore: prefer_const_constructors_in_immutables
NavigationBar({
super.key,
this.animationDuration,
this.selectedIndex = 0,
required this.destinations,
this.onDestinationSelected,
this.backgroundColor,
this.elevation,
this.shadowColor,
this.surfaceTintColor,
this.indicatorColor,
this.indicatorShape,
this.height,
this.labelBehavior,
this.overlayColor,
}) : assert(destinations.length >= 2),
assert(0 <= selectedIndex && selectedIndex < destinations.length);