dnd_kit 0.3.0-dev.0
dnd_kit: ^0.3.0-dev.0 copied to clipboard
Pure Dart core engine for the dnd_kit drag-and-drop family. Flutter apps use dnd_kit_flutter; Jaspr apps use dnd_kit_jaspr.
dnd_kit #
dnd_kit is the pure Dart core engine for the dnd_kit drag-and-drop family.
It contains the framework-neutral drag runtime, geometry, collision detection, modifiers, registry contracts, sensor contracts, sortable math, and auto-scroll math shared by every adapter. It has no Flutter dependency.
Building an app? You usually want an adapter, not this package directly: Flutter apps depend on
dnd_kit_flutter; Jaspr (Dart web) apps depend ondnd_kit_jaspr. Depend ondnd_kitdirectly only when you need the framework-agnostic engine (custom adapters, testable drag/drop math, or contract tests).
Migrating from
dnd_kit0.1.x? Those releases were the Flutter umbrella that re-exporteddnd_kit_flutter. As of0.3.0-dev.0,dnd_kitis the engine. Replacepackage:dnd_kit/dnd_kit.dartwithpackage:dnd_kit_flutter/dnd_kit_flutter.dartand depend ondnd_kit_flutter.
Import #
import 'package:dnd_kit/dnd_kit.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 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. The Jaspr component layer lives in
dnd_kit_jaspr.
dnd_kit family #
| Package | Use it for |
|---|---|
dnd_kit |
The shared, framework-agnostic engine. Build adapters or use the math. |
dnd_kit_flutter |
Flutter apps — widgets, sensors, overlays, and sortable presets. |
dnd_kit_jaspr |
Jaspr (Dart web) apps — the current dev adapter release. |