Board constructor
Board({
- required GlobalKey<
State< boardKey,StatefulWidget> > - required PieceSet pieceSet,
- required BoardState state,
- required BoardTheme theme,
- BoardSize size = const BoardSize(8, 8),
- HighlightTheme? highlightTheme,
- int? selection,
- int? target,
- bool gameOver = false,
- bool canMove = false,
- bool draggable = true,
- double dragFeedbackSize = 2.0,
- Offset dragFeedbackOffset = const Offset(0.0, -1.0),
- dynamic onTap()?,
- dynamic onDragCancel()?,
- bool validateDrag()?,
- dynamic acceptDrag()?,
- List<
int> highlights = const [], - bool allowAnimation = true,
- Duration? animationDuration,
- 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;