Piece class
Constructors
Piece ({Key ? key , required Widget child , required PartialMove move , bool draggable = true , bool interactible = true , double dragFeedbackSize = 2.0 , Offset dragFeedbackOffset = const Offset(0.0, -1.0) , VoidCallback ? onTap , VoidCallback ? onDragStarted , VoidCallback ? onDragCancelled , void onDragEnd (DraggableDetails )? })
const
Properties
child
→ Widget
A widget that represents the piece.
final
dragFeedbackOffset
→ Offset
A vector to offset the position of dragged pieces by, relative to the size of the piece.
No offset is recommended for web, and Offset(0,-1) for mobile, in which case
the bottom of the piece will be anchored to the finger.
final
dragFeedbackSize
→ double
The size of the piece being dragged will be multiplied by this.
1.5 is a good value for mobile, but 1.0 is preferable for web.
final
draggable
→ bool
Whether the piece on this square can be dragged.
final
hashCode
→ int
The hash code for this object.
no setter inherited
interactible
→ bool
Whether the piece can be interacted with.
This must be false when any other piece is being dragged, to avoid
the GestureDetector absorbing the drag.
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
move
→ PartialMove
A single-character symbol representing the piece of the square. e.g. 'N', 'k'.
final
onDragCancelled
→ VoidCallback ?
Called when a drag is cancelled.
final
onDragEnd
→ (void Function(DraggableDetails ) ?)
Called when a drag ends, i.e. it was dropped on a target.
final
onDragStarted
→ VoidCallback ?
Called when a drag is started.
final
onTap
→ VoidCallback ?
Called when the piece is tapped.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited