Board constructor
Board({
- Key? key,
- required BoardState state,
- PlayState playState = PlayState.observing,
- required PieceSet pieceSet,
- BoardTheme theme = BoardTheme.blueGrey,
- BoardSize size = BoardSize.standard,
- MarkerTheme? markerTheme,
- int? selection,
- int? target,
- List<
PieceSelectorData> pieceSelectors = const [], - bool draggable = true,
- double dragFeedbackSize = 2.0,
- Offset dragFeedbackOffset = const Offset(0.0, -1.0),
- PlayerSet dragPermissions = PlayerSet.both,
- DragTargetFeedback? dragTargetFeedback,
- void onTap()?,
- void onPieceSelected(
- PieceSelectorData data,
- int i
- void onDragCancel()?,
- bool validateDrag()?,
- void acceptDrag()?,
- List<
int> markers = const [], - bool animatePieces = true,
- Duration animationDuration = Squares.defaultAnimationDuration,
- Curve animationCurve = Squares.defaultAnimationCurve,
- List<
Widget> underlays = const [], - List<
Widget> overlays = const [], - bool externalDrag = false,
- LabelConfig labelConfig = LabelConfig.standard,
- BackgroundConfig backgroundConfig = BackgroundConfig.standard,
- Widget? background,
- 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;