NavRail constructor

const NavRail({
  1. Key? key,
  2. List<NrButtonWidget> buttons = const [],
  3. List<NrButtonWidget> actions = const [],
  4. int selectedButtonIndex = 0,
  5. int selectedActionIndex = -1,
  6. int selectedSecondaryActionIndex = -1,
  7. bool expandable = false,
  8. bool expanded = false,
  9. double minWidth = 0,
  10. double maxWidth = 0,
  11. double minHeight = 0,
  12. double maxHeight = 0,
  13. NavRailDirection direction = NavRailDirection.vertical,
  14. NavRailButtonLabelPosition? labelPosition,
  15. Color? backgroundColor,
  16. Color? foregroundColor,
  17. Color? selectedColor,
  18. Color? selectedBackgroundColor,
  19. Color? unselectedColor,
  20. Color? unselectedBackgroundColor,
  21. bool verticleScrolling = false,
  22. Widget? leading,
  23. Widget? smallLeading,
  24. bool leadingOnTop = false,
  25. double expandableButtonHeight = 40,
  26. bool showActionSelectedIndex = true,
  27. bool showSecondaryActionSelectedIndex = true,
})

Creates a NavRail widget.

The buttons parameter is required. All other parameters are optional and will use appropriate defaults.

Implementation

const NavRail({
  super.key,
  this.buttons = const [],
  this.actions = const [],
  this.selectedButtonIndex = 0,
  this.selectedActionIndex = -1,
  this.selectedSecondaryActionIndex = -1,
  this.expandable = false,
  this.expanded = false,
  this.minWidth = 0,
  this.maxWidth = 0,
  this.minHeight = 0,
  this.maxHeight = 0,
  this.direction = NavRailDirection.vertical,
  this.labelPosition,
  this.backgroundColor,
  this.foregroundColor,
  this.selectedColor,
  this.selectedBackgroundColor,
  this.unselectedColor,
  this.unselectedBackgroundColor,
  this.verticleScrolling = false,
  this.leading,
  this.smallLeading,
  this.leadingOnTop = false,
  this.expandableButtonHeight = 40,
  this.showActionSelectedIndex = true,
  this.showSecondaryActionSelectedIndex = true,
});