ToggleButtons constructor

const ToggleButtons(
  1. {Key key,
  2. @required List<Widget> children,
  3. @required List<bool> isSelected,
  4. void onPressed(
    1. int index
    ),
  5. MouseCursor mouseCursor,
  6. TextStyle textStyle,
  7. BoxConstraints constraints,
  8. Color color,
  9. Color selectedColor,
  10. Color disabledColor,
  11. Color fillColor,
  12. Color focusColor,
  13. Color highlightColor,
  14. Color hoverColor,
  15. Color splashColor,
  16. List<FocusNode> focusNodes,
  17. bool renderBorder: true,
  18. Color borderColor,
  19. Color selectedBorderColor,
  20. Color disabledBorderColor,
  21. BorderRadius borderRadius,
  22. double borderWidth}
)

Creates a horizontal set of toggle buttons.

It displays its widgets provided in a List of children horizontally. The state of each button is controlled by isSelected, which is a list of bools that determine if a button is in an active, disabled, or selected state. They are both correlated by their index in the list. The length of isSelected has to match the length of the children list.

Both children and isSelected properties arguments are required.

isSelected values must be non-null. focusNodes must be null or a list of non-null nodes. renderBorder must not be null.

Implementation

const ToggleButtons({
  Key key,
  @required this.children,
  @required this.isSelected,
  this.onPressed,
  this.mouseCursor,
  this.textStyle,
  this.constraints,
  this.color,
  this.selectedColor,
  this.disabledColor,
  this.fillColor,
  this.focusColor,
  this.highlightColor,
  this.hoverColor,
  this.splashColor,
  this.focusNodes,
  this.renderBorder = true,
  this.borderColor,
  this.selectedBorderColor,
  this.disabledBorderColor,
  this.borderRadius,
  this.borderWidth,
}) :
  assert(children != null),
  assert(isSelected != null),
  assert(children.length == isSelected.length),
  super(key: key);