Board constructor

Board({
  1. required GlobalKey<State<StatefulWidget>> boardKey,
  2. required PieceSet pieceSet,
  3. required BoardState state,
  4. required BoardTheme theme,
  5. BoardSize size = const BoardSize(8, 8),
  6. HighlightTheme? highlightTheme,
  7. int? selection,
  8. int? target,
  9. bool gameOver = false,
  10. bool canMove = false,
  11. bool draggable = true,
  12. double dragFeedbackSize = 2.0,
  13. Offset dragFeedbackOffset = const Offset(0.0, -1.0),
  14. dynamic onTap(
    1. int,
    2. GlobalKey<State<StatefulWidget>>
    )?,
  15. dynamic onDragCancel(
    1. int
    )?,
  16. bool validateDrag(
    1. PartialMove,
    2. int
    )?,
  17. dynamic acceptDrag(
    1. PartialMove,
    2. int,
    3. GlobalKey<State<StatefulWidget>>
    )?,
  18. List<int> highlights = const [],
  19. bool allowAnimation = true,
  20. Duration? animationDuration,
  21. Curve? animationCurve,
})

Implementation

Board({
  required this.boardKey,
  required this.pieceSet,
  required this.state,
  required this.theme,
  this.size = const BoardSize(8, 8),
  HighlightTheme? highlightTheme,
  this.selection,
  this.target,
  this.gameOver = false,
  this.canMove = false,
  this.draggable = true,
  this.dragFeedbackSize = 2.0,
  this.dragFeedbackOffset = const Offset(0.0, -1.0),
  this.onTap,
  this.onDragCancel,
  this.validateDrag,
  this.acceptDrag,
  this.highlights = const [],
  this.allowAnimation = true,
  this.animationDuration,
  this.animationCurve,
}) : this.highlightTheme = highlightTheme ?? HighlightTheme.basic;