DragTarget<T> class
A wrapper widget that accepts dropped data from a Draggable.
Constructors
-
DragTarget({required Widget builder(BuildContext context, List<
T> candidateData, List rejectedData), bool onWillAccept(T data)?, void onAccept(T data)?, void onLeave(T? data)?, Key? key}) -
Creates a DragTarget widget.
const
Properties
-
builder
→ Widget Function(BuildContext context, List<
T> candidateData, List rejectedData) -
The builder function that describes the widget content based on drag hover state.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
The optional key for this widget.
finalinherited
- onAccept → void Function(T data)?
-
Triggered when the payload is successfully dropped.
final
- onLeave → void Function(T? data)?
-
Triggered when the drag leaves the target boundary.
final
- onWillAccept → bool Function(T data)?
-
Optional callback to check if a payload will be accepted.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
override
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.override -
getIntrinsicWidth(
int height) → int -
Computes the intrinsic width of this widget under the given
heightconstraint.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited