dnd_kit_core 0.1.0-dev.1 copy "dnd_kit_core: ^0.1.0-dev.1" to clipboard
dnd_kit_core: ^0.1.0-dev.1 copied to clipboard

discontinuedreplaced by: dnd_kit

Pure Dart core primitives and algorithms for dnd_kit.

example/example.md

dnd_kit_core Example #

dnd_kit_core provides pure Dart geometry, collision, modifier, state, sensor, registry, and diagnostics primitives. It has no Flutter dependency.

import 'package:dnd_kit_core/dnd_kit_core.dart';

void main() {
  const activeRect = DndRect(left: 0, top: 0, width: 80, height: 40);
  const droppableRects = <DndId, DndRect>{
    DndId('todo'): DndRect(left: 0, top: 80, width: 240, height: 200),
    DndId('done'): DndRect(left: 280, top: 80, width: 240, height: 200),
  };

  final collisions = DndCollisionDetectors.closestCenter(
    const DndCollisionInput(
      activeRect: activeRect,
      droppableRects: droppableRects,
    ),
  );

  final overId = collisions.isEmpty ? null : collisions.first.id;
  print('Dragging over: ${overId?.value}');
}

Use dnd_kit_core directly when you need testable drag/drop math or contracts without Flutter widgets. Use the main dnd_kit package for Flutter scopes, draggables, droppables, overlays, sensors, auto-scroll, and sortable presets.

1
likes
0
points
306
downloads

Publisher

unverified uploader

Weekly Downloads

Pure Dart core primitives and algorithms for dnd_kit.

Homepage
Repository (GitHub)
View/report issues

Topics

#drag-and-drop #dnd #geometry #sortable

License

unknown (license)

Dependencies

collection, meta

More

Packages that depend on dnd_kit_core