diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart index 677b11b062..a1389c32ea 100644 --- a/packages/flutter/lib/src/widgets/drag_target.dart +++ b/packages/flutter/lib/src/widgets/drag_target.dart @@ -39,9 +39,10 @@ typedef DragTargetAcceptWithDetails = void Function(DragTargetDetails deta /// Signature for building children of a [DragTarget]. /// /// The `candidateData` argument contains the list of drag data that is hovering -/// over this [DragTarget] and that has passed [DragTarget.onWillAccept]. The -/// `rejectedData` argument contains the list of drag data that is hovering over -/// this [DragTarget] and that will not be accepted by the [DragTarget]. +/// over this [DragTarget] and that has passed +/// [DragTarget.onWillAcceptWithDetails]. The `rejectedData` argument contains +/// the list of drag data that is hovering over this [DragTarget] and that will +/// not be accepted by the [DragTarget]. /// /// Used by [DragTarget.builder]. typedef DragTargetBuilder = Widget Function(BuildContext context, List candidateData, List rejectedData); @@ -633,6 +634,20 @@ class DragTarget extends StatefulWidget { /// /// The builder can build different widgets depending on what is being dragged /// into this drag target. + /// + /// [onWillAccept] or [onWillAcceptWithDetails] is called when a draggable + /// enters the target. If true, then the data will appear in `candidateData`, + /// else in `rejectedData`. + /// + /// Typically the builder will check `candidateData` and `rejectedData` and + /// build a widget that indicates the result of dropping the `candidateData` + /// onto this target. + /// + /// The `candidateData` and `rejectedData` are [List] types to support multiple + /// simultaneous drags. + /// + /// If unexpected `null` values in `candidateData` or `rejectedData`, ensure + /// that the `data` argument of the [Draggable] is not `null`. final DragTargetBuilder builder; /// Called to determine whether this widget is interested in receiving a given