NavigationBar constructor Null safety

const NavigationBar(
  1. {Key? key,
  2. Duration? animationDuration,
  3. int selectedIndex = 0,
  4. required List<Widget> destinations,
  5. ValueChanged<int>? onDestinationSelected,
  6. Color? backgroundColor,
  7. double? elevation,
  8. double? height,
  9. NavigationDestinationLabelBehavior? labelBehavior}
)

Creates a Material 3 Navigation Bar component.

The value of destinations must be a list of two or more NavigationDestination values.

Implementation

const NavigationBar({
  Key? key,
  this.animationDuration,
  this.selectedIndex = 0,
  required this.destinations,
  this.onDestinationSelected,
  this.backgroundColor,
  this.elevation,
  this.height,
  this.labelBehavior,
}) :  assert(destinations != null && destinations.length >= 2),
      assert(0 <= selectedIndex && selectedIndex < destinations.length),
      super(key: key);