Board constructor

Board({
  1. Key? key,
  2. required BoardState state,
  3. PlayState playState = PlayState.observing,
  4. required PieceSet pieceSet,
  5. BoardTheme theme = BoardTheme.blueGrey,
  6. BoardSize size = BoardSize.standard,
  7. MarkerTheme? markerTheme,
  8. int? selection,
  9. int? target,
  10. List<PieceSelectorData> pieceSelectors = const [],
  11. bool draggable = true,
  12. double dragFeedbackSize = 2.0,
  13. Offset dragFeedbackOffset = const Offset(0.0, -1.0),
  14. PlayerSet dragPermissions = PlayerSet.both,
  15. DragTargetFeedback? dragTargetFeedback,
  16. void onTap(
    1. int
    )?,
  17. void onPieceSelected(
    1. PieceSelectorData data,
    2. int i
    )?,
  18. void onDragCancel(
    1. int
    )?,
  19. bool validateDrag(
    1. PartialMove,
    2. int
    )?,
  20. void acceptDrag(
    1. PartialMove,
    2. int
    )?,
  21. List<int> markers = const [],
  22. bool animatePieces = true,
  23. Duration animationDuration = Squares.defaultAnimationDuration,
  24. Curve animationCurve = Squares.defaultAnimationCurve,
  25. List<Widget> underlays = const [],
  26. List<Widget> overlays = const [],
  27. bool externalDrag = false,
  28. LabelConfig labelConfig = LabelConfig.standard,
  29. BackgroundConfig backgroundConfig = BackgroundConfig.standard,
  30. Widget? background,
  31. double piecePadding = 0.0,
})

Implementation

Board({
  super.key,
  required this.state,
  this.playState = PlayState.observing,
  required this.pieceSet,
  this.theme = BoardTheme.blueGrey,
  this.size = BoardSize.standard,
  MarkerTheme? markerTheme,
  this.selection,
  this.target,
  this.pieceSelectors = const [],
  this.draggable = true,
  this.dragFeedbackSize = 2.0,
  this.dragFeedbackOffset = const Offset(0.0, -1.0),
  this.dragPermissions = PlayerSet.both,
  this.dragTargetFeedback,
  this.onTap,
  this.onPieceSelected,
  this.onDragCancel,
  this.validateDrag,
  this.acceptDrag,
  this.markers = const [],
  this.animatePieces = true,
  this.animationDuration = Squares.defaultAnimationDuration,
  this.animationCurve = Squares.defaultAnimationCurve,
  this.underlays = const [],
  this.overlays = const [],
  this.externalDrag = false,
  this.labelConfig = LabelConfig.standard,
  this.backgroundConfig = BackgroundConfig.standard,
  this.background,
  this.piecePadding = 0.0,
}) : markerTheme = markerTheme ?? MarkerTheme.basic;