dnd_kit_flutter 0.6.0
dnd_kit_flutter: ^0.6.0 copied to clipboard
Flutter drag-and-drop toolkit with core widgets, sensors, measuring, overlays, and sortable presets.
Changelog #
0.6.0 #
- Depends on
dnd_kit: ^0.6.0, inheriting the drag-default fixes: the active item is no longer its own drop target, drag start re-measures droppables, andSortableStrategies.dropOnOverlands the drop where the highlight is. - Breaking behavior:
DndAutoScrollnow invalidates measurements and re-resolves collision on every auto-scroll tick, sooverIdfollows content moving under a stationary pointer.DndAutoScrollControllertakes anonScrolledcallback for direct use. - Breaking behavior:
DndDragOverlaysizes the preview from the drag-start rect instead of the live active rect, so collapsing the source slot to open a placeholder gap no longer clips the preview to zero.DndDragOverlayDetailsgains a requiredinitialActiveRectalongside the liveactiveRect. DndControllerexposesinitialActiveRect.- Adds live sortable feedback:
SortableScopeData.previewandSortableMultiScopeData.previewreport where the active item would land, andSortableItemDetailsgainspreviewIndex,previewContainerId, andoffset. SortableScopetakes anoffsetResolver(defaultSortableOffsets.none). SetSortableOffsets.verticalListand applydetails.offsetinside yourSortableItem.builder— withAnimatedSlideorTransform.translate— to open a placeholder gap. Apply it inside the builder, not around the item, so the shift stays below the measured box.SortableMultiContainerAreais now aStatefulWidgetso it can publish its strategy to the scope. Its constructor is unchanged.SortableMultiScopetakes anoffsetResolver(defaultSortableMultiOffsets.none), so a board can open a live gap within and across columns. Applydetails.offsetinside yourSortableMultiItembuilder.DndControllertakes an optionalcollisionDetectorand exposes it as a settable property.SortableMultiScopetakes an optionalcollisionDetectorand installs its effective detector on whatever controller it is given — including one the application created and passed in — so a board wired to an external controller ranks collisions correctly with no manual setup.- Inherits the core multi-container refinements: cross-container insertion tracks the pointer within the hovered card, the gap between cards (and the space below the last card) resolves to the nearest card, and picking an item up or dropping it back in place no longer reorders.
0.5.0 #
- Depends on
dnd_kit: ^0.5.0(DndCollisionInput.activeId).
0.4.0 #
- Depends on
dnd_kit: ^0.4.0. - Adds a production multi-container adapter surface:
SortableMultiScope,SortableMultiContainerArea, andSortableMultiItem. - Default cross-container collision ranking and drag-end move resolution now
come from the shared
dnd_kitcore contract, so apps no longer have to wire a custom detector or item-levelonDragEndcallback for the common case. - The runnable multi-container example now uses the supported adapter surface and a single-phase application-owned state update.
- Keeps exporting the experimental multi-container helper contract from
package:dnd_kit_flutter/dnd_kit_flutter.dart, but the underlyingSortableContainerandSortableMultiContainersource now lives in the shareddnd_kitengine so Jaspr can reuse the same move-intent helper.
0.3.2 #
- Updates the pub.dev homepage metadata to the hosted project website.
- Refreshes the package links for the repository transfer to
iamv4g/dnd_kit. - Depends on
dnd_kit: ^0.3.2with no runtime API changes.
0.3.1 #
- Depends on
dnd_kit: ^0.3.1, which now owns the sharedDndAnnouncementsaccessibility contract reused by both adapters. - Adds scope-level drag lifecycle announcements for assistive technologies through Flutter's announcement APIs.
DndDraggableandDndDragHandlenow support optional semanticslabelandhintfields so applications can provide accessible naming and usage instructions without forking drag behavior.- Keyboard drag focus stays on the activator through pickup, movement, drop, and cancel flows, with widget-test coverage for focus and announcement behavior.
0.3.0 #
- Depends on the renamed engine package
dnd_kit: ^0.3.0(previouslydnd_kit_core, now discontinued). The dependency rename tracks the engine package becomingdnd_kit. See ADR 0017. - Adopts the axis-aware shared auto-scroll contract from
dnd_kitby adding horizontal support toDndAutoScrollandDndAutoScrollControllerwhile preserving vertical default behavior. - The Kanban example now uses
DndAutoScroll(axis: DndScrollAxis.horizontal)instead of a custom app-owned horizontal board auto-scroll helper.
0.2.0-dev.0 #
- Starts the shared-runtime development line for
dnd_kit_flutteron top ofdnd_kit_core: ^0.2.0-dev.0. - Breaking:
DndPointerSensormoved todnd_kit_coreand is now driven by aDndRuntimeinstead of aDndController. Construct it withDndPointerSensor(runtime: controller.runtime, ...). The class remains importable frompackage:dnd_kit_flutter/dnd_kit_flutter.dartvia re-export. This lets the Flutter and Jaspr adapters share one pointer-activation state machine. - Added
DndController.runtimeto expose the shared runtime to adapter sensors.
0.1.0 #
- First public release of the Flutter adapter under the
dnd_kit_fluttername (previously published asdnd_kit). Includes scope/controller, draggable, droppable, drag handle, overlay, pointer/long-press/keyboard sensors, measuring, auto-scroll, diagnostics, and stable sortable presets. - Depends on
dnd_kit_core: ^0.1.0. - Breaking: removed
DndLongPressActivation.hapticFeedback. Haptic feedback is now configured throughDndDraggable.enableHapticFeedbackor the nearestDndScope.enableHapticFeedbackdefault, which defaults totrue. - Touch drag activation now emits one
HapticFeedback.selectionClick()pulse by default when the drag starts, including both the platform-adaptive delayed touch path and explicitlongPressActivation. Mouse, trackpad, and keyboard activations emit no haptic feedback. - Fixed active drag geometry so overlays and collision detection stay aligned with the pointer when a scrollable ancestor moves during the drag.
- Draggables now work inside scrollables, including lazy
ListView.builder.DndDraggableactivates through an arena-winningMultiDragGestureRecognizerinstead of a pan recognizer, so a drag can start without losing the gesture to an enclosingScrollable. - Behavior change: default activation is now platform-adaptive — precise
pointers (mouse) drag immediately, while touch uses a short hold (delayed) so a
quick touch can still scroll. Set
activationConstraint: DndSensorActivationConstraint(distance: …)for immediate touch drag. - Sortable strategies (
verticalList,horizontalList,grid) now compute reorder intent from the measured (visible) item subset, so reordering stays correct in lazy lists where off-screen items are not measured. - An active drag and its registration/measured rect now survive the source element being recycled by a lazy list mid-drag.
- Fixed a
Duplicate draggable/droppable idcrash that could occur while auto-scrolling a lazy list during a drag, when the list re-mounts a keyed item before disposing the old one.findChildIndexCallbackis now a performance recommendation rather than a requirement. - Duplicate
DndDraggable/DndDroppableids that remain mounted after widget reconciliation now surface an actionableDndDiagnosticsConfig.onWarningcallback instead of staying silently last-wins. - The Kanban and multi-container examples now use
ListView.builder(withfindChildIndexCallback) to demonstrate lazy sortable columns. The Kanban board is lazy in both axes — the horizontal column row and each column's vertical task list. Their task cards use the default platform-adaptive activation (immediate with a mouse, hold-to-drag on touch) so a quick swipe scrolls the list instead of starting a drag.
0.1.0-dev.1 #
- Added a package-local
example/example.mdso pub.dev can render a compact illustrative example for the package. - Clarified package README links to the quick example and full runnable repository examples.
- Updated the
dnd_kit_coredependency to^0.1.0-dev.1.
0.1.0-dev.0 #
- Initial development release of the main
dnd_kitFlutter package. - Includes core drag/drop widgets, scope/controller APIs, pointer, long-press, and keyboard activation, measuring, collision runtime, modifiers, drag overlays, visual state builders, auto-scroll, diagnostics, and stable sortable list/grid presets.
- Exposes the pure Dart
dnd_kit_coreAPI through the main package for application convenience. - Keeps experimental multi-container sortable helpers out of the stable same-container sortable contract.