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. void onTap(
    1. int
    )?,
  16. void onPieceSelected(
    1. PieceSelectorData data,
    2. int i
    )?,
  17. void onDragCancel(
    1. int
    )?,
  18. bool validateDrag(
    1. PartialMove,
    2. int
    )?,
  19. void acceptDrag(
    1. PartialMove,
    2. int
    )?,
  20. List<int> markers = const [],
  21. bool animatePieces = true,
  22. Duration animationDuration = Squares.defaultAnimationDuration,
  23. Curve animationCurve = Squares.defaultAnimationCurve,
  24. List<Widget> underlays = const [],
  25. List<Widget> overlays = const [],
  26. bool externalDrag = false,
  27. LabelConfig labelConfig = LabelConfig.standard,
  28. BackgroundConfig backgroundConfig = BackgroundConfig.standard,
  29. Widget? background,
  30. 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.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;