dnd_kit_jaspr library
Jaspr (web) adapter for the dnd_kit drag-and-drop family.
dnd_kit_jaspr is built on the shared dnd_kit engine, so Jaspr and
Flutter behave as peer adapters over one drag runtime. Applications import
this library directly:
import 'package:dnd_kit_jaspr/dnd_kit_jaspr.dart';
It re-exports the pure Dart core (geometry, state, events, collision, modifiers, sortable math, the drag runtime, and diagnostics) and adds the Jaspr component layer: DndScope, DndController, DndDraggable, DndDroppable, DndDragHandle, DndDragOverlay, DndAutoScroll, and the sortable preset (SortableScope, SortableItem).
Applications own their item, board, or document data. dnd_kit_jaspr
reports drag/drop intent so app code can update its own state.
Classes
- DndAnnouncements
- Configurable accessibility announcements shared by adapter drag lifecycles.
- DndAutoScroll
- Drag-driven auto-scroll for a Jaspr scroll container.
- DndAutoScrollOptions
- Edge-threshold and velocity settings for drag-driven auto-scroll.
- DndCancelled
- A pending or active drag has been cancelled.
- DndCollision
- A single collision candidate with a comparable score.
- DndCollisionDetectors
- Built-in pure Dart collision detectors.
- DndCollisionInput
- Input shared by built-in and custom collision detectors.
- DndCollisionResult
- Sorted collision detector output.
- DndController
- Coordinates Jaspr adapter drag state while keeping user data external.
- DndDiagnosticsConfig
- Configures non-fatal diagnostics for dnd_kit runtime components.
- DndDragCancelEvent
- Event emitted when a pending or active drag is cancelled.
- DndDragEndEvent
- Event emitted when the active drag ends.
- DndDragEvent
- Base type for drag lifecycle events.
- DndDraggable
- A drag source for the Jaspr adapter.
- DndDraggableHandleController
- DndDraggableHandleScope
- DndDraggableRegistration
- Pure Dart metadata for a registered draggable.
- DndDragging
- A drag session is actively moving.
- DndDragHandle
- Marks a child region as an explicit drag activation handle.
- DndDragMoveEvent
- Event emitted when the active drag moves.
- DndDragOverEvent
- Event emitted when the active drag is evaluated over a droppable target.
- DndDragOverlay
- Renders an independently positioned visual for the active drag session.
- DndDragOverlayDetails
- State exposed to a DndDragOverlayBuilder.
- DndDragSession
- Immutable data for an active drag session.
- DndDragStartEvent
- Event emitted when a drag session starts.
- DndDroppable
- Registers a child as a droppable target in the nearest drag-and-drop scope.
- DndDroppableDetails
- State exposed to a DndDroppableBuilder.
- DndDroppableRegistration
- Pure Dart metadata for a registered droppable.
- DndDropping
- A drag has completed and is waiting for drop handling to settle.
- DndId
- Stable identifier used for draggables, droppables, containers, and sortable items.
- DndIdle
- No drag is active or pending.
- DndLiveRegion
- A visually-hidden ARIA live region that announces drag lifecycle changes.
- DndMeasuringRegistry
- Adapter-owned measured rectangles for drag-and-drop sources and targets.
- DndModifierInput
- Input shared by built-in and custom drag modifiers.
- DndModifiers
- Built-in pure Dart transform modifiers.
- DndPending
- A drag has been activated but has not moved into a drag session yet.
- DndPoint
- A point in a two-dimensional coordinate space.
- DndPointerSensor
- Framework-neutral pointer sensor runtime that coordinates activation constraints over a shared DndRuntime.
- DndRect
- An axis-aligned rectangle represented by its top-left point and size.
- DndRegistry
- Pure Dart registry for draggable and droppable entries.
- DndRegistrySnapshot
- Immutable view of the currently registered draggable and droppable entries.
- DndRuntime
- Framework-neutral owner of the drag lifecycle.
- DndScope
- Provides a DndController to a Jaspr subtree.
- DndSensor
- Interface implemented by adapter-specific sensor runtimes.
- DndSensorActivationConstraint
- Activation constraints used by sensors before a drag session starts.
- DndSensorActivationEvent
- Pure Dart activation data shared by sensor implementations.
- DndSensorDescriptor
- Describes a sensor that an adapter can install.
- DndSize
- A two-dimensional size.
- DndState
- A drag lifecycle state.
- DndTransform
- A pure Dart transform used to describe drag translation and scale.
- DndWarning
- A non-fatal warning emitted when dnd_kit detects likely misconfiguration.
- SortableContainer
- Sortable container metadata for multi-container sorting.
- SortableItem
- Registers a child as a sortable item in the nearest SortableScope.
- SortableItemDetails
- State exposed to a SortableItemBuilder.
- SortableMoveDetails
- Details for an application-owned sortable reorder intent.
- SortableMultiContainer
- Helpers for production multi-container sortable semantics.
- SortableMultiContainerArea
- Registers a sortable container area for the common multi-container case.
- SortableMultiContainerAreaData
- Immutable data exposed by SortableMultiContainerArea.
- SortableMultiItem
- Registers a child as a sortable item in the nearest SortableMultiScope.
- SortableMultiMoveInput
- Pure-Dart input used to resolve multi-container move intent.
- SortableMultiScope
- Provides production multi-container sortable behavior to a Jaspr subtree.
- SortableMultiScopeData
- Immutable data exposed by SortableMultiScope.
- SortableScope
- Provides sortable order and drag controller state to a Jaspr subtree.
- SortableScopeData
- Immutable data exposed by SortableScope.
- SortableStrategies
- Built-in sortable strategies.
- SortableStrategyInput
- Input passed to a SortableStrategy.
Enums
- DndCancelReason
- Why an active or pending drag was cancelled.
- DndInputKind
- The input source that activated a drag session.
- DndMeasurementStatus
- Current cache state for an adapter-owned measurement.
- DndScrollAxis
- The shared axis used by drag-driven auto-scroll math.
- DndSensorKind
- The type of sensor producing drag activation input.
- SortableMultiInsertionStrategy
- How cross-container drops resolve around an over-item target.
Functions
-
dndAutoScrollVelocity(
{required DndPoint localPointer, required DndSize viewportSize, required double scrollPixels, required double minScrollExtent, required double maxScrollExtent, DndScrollAxis axis = DndScrollAxis.vertical, DndAutoScrollOptions options = const DndAutoScrollOptions()}) → double - Computes the per-frame auto-scroll velocity for a scroll viewport.
Typedefs
- DndCollisionDetector = DndCollisionResult Function(DndCollisionInput input)
- Detects which droppable rectangles collide with the active draggable.
- DndDeferredTaskScheduler = void Function(void task())
- Schedules a deferred registry task after transient reconciliation settles.
- DndDragCancelAnnouncement = String Function(DndId active)
- Builds the text announced when a drag is cancelled.
- DndDragCancelCallback = void Function(DndDragCancelEvent event)
- Called when a pending or active draggable is cancelled.
- DndDragEndAnnouncement = String Function(DndId active, DndId? over)
- Builds the text announced when a drag drops.
- DndDragEndCallback = void Function(DndDragEndEvent event)
- Called when an active draggable ends.
- DndDragMoveCallback = void Function(DndDragMoveEvent event)
- Called when an active draggable moves.
- DndDragOverAnnouncement = String Function(DndId active, DndId? over)
- Builds the text announced when the drag-over target changes.
- DndDragOverlayBuilder = Component Function(BuildContext context, DndDragOverlayDetails details)
- Builds the visual shown by DndDragOverlay for an active drag session.
- DndDragStartAnnouncement = String Function(DndId active)
- Builds the screen-reader text announced when a drag starts.
- DndDragStartCallback = void Function(DndDragStartEvent event)
- Called when a draggable starts a drag session.
- DndDroppableBuilder = Component Function(BuildContext context, DndDroppableDetails details, Component child)
- Builds a droppable visual from the current drag state.
- DndModifier = DndTransform Function(DndModifierInput input)
- Modifies the active drag transform before it is applied.
- DndSensorActivator = bool Function(DndSensorActivationEvent event)
- Decides whether a sensor activation event should start pending activation.
- DndWarningCallback = void Function(DndWarning warning)
- Receives non-fatal diagnostics emitted by dnd_kit.
- SortableItemBuilder = Component Function(BuildContext context, SortableItemDetails details, Component child)
- Builds a sortable item visual from current drag state.
- SortableMoveCallback = void Function(SortableMoveDetails details)
- Called when a sortable item is dropped over another sortable item.
- SortableMultiMoveResolver = SortableMoveDetails? Function(SortableMultiMoveInput input)
- Resolves multi-container move intent from pure-Dart input.
- SortableStrategy = SortableMoveDetails? Function(SortableStrategyInput input)
- Computes sortable move intent for a drag end.