dnd_kit_core
dnd_kit_core contains the pure Dart foundation for dnd_kit.
Use this package when you need drag-and-drop primitives, runtime, geometry, collision detection, modifiers, registry contracts, or sensor contracts without depending on Flutter.
Import
import 'package:dnd_kit_core/dnd_kit_core.dart';
What It Provides
DndIdfor stable application-owned identifiers.DndPoint,DndSize,DndRect, andDndTransformfor toolkit geometry.DndState,DndDragSession, and drag events for lifecycle modeling.DndRuntimeas the shared framework-neutral drag engine.DndCollisionDetectorplus built-in detectors such asDndCollisionDetectors.closestCenter,DndCollisionDetectors.closestCorners,DndCollisionDetectors.rectIntersection, andDndCollisionDetectors.pointerWithin.DndModifierplus built-in modifiers such asDndModifiers.restrictToVerticalAxis,DndModifiers.restrictToHorizontalAxis,DndModifiers.restrictToBoundary, andDndModifiers.snapToGrid.DndRegistryand diagnostics hooks for draggable and droppable metadata.DndMeasuringRegistry, sortable move/strategy math, and auto-scroll edge/velocity helpers shared by adapters.
Package Boundary
dnd_kit_core intentionally has no Flutter dependency. It does not import
package:flutter/*, dart:ui, BuildContext, RenderBox, Offset, Rect,
or Size.
Flutter widgets, measuring, overlays, auto-scroll, and stable sortable presets
live in the dnd_kit_flutter adapter (re-exported by dnd_kit).
dnd_kit family
| Package | Use it for |
|---|---|
dnd_kit |
Flutter apps — the stable, recommended Flutter entry point (re-exports dnd_kit_flutter). |
dnd_kit_flutter |
Flutter apps that want dev releases or the explicit adapter package. |
dnd_kit_jaspr |
Jaspr (Dart web) apps — the current dev adapter release. |
dnd_kit_core |
The shared, framework-agnostic engine. |
Libraries
- dnd_kit_core
- Pure Dart core primitives and algorithms for dnd_kit.