Skip to content
pubscout

drag_select_grid_view

0.7.7, released 3 months ago by hugopassos.dev

A Flutter grid that supports both dragging and tapping to select its items.

WASM-ready
$ flutter pub add drag_select_grid_view
Source repository

What it does

Provides a GridView alternative that enables users to select multiple grid items by tapping or dragging across them. It tracks the selection state via a controller and supports auto-scrolling during drag gestures.

AI-written summary of version 0.7.7, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a photo gallery or file manager style multi-selection grid.
  • Users need to select items by tapping or dragging across multiple items.

Skip it when

  • You only need a standard non-selectable grid view.
  • You require complex drag-and-drop reordering rather than item selection.

Strengths

  • Supports both drag and tap selection mechanics out of the box.
  • Includes auto-scroll capabilities when dragging near the edges of the grid.

Weaknesses

  • Requires writing supplementary custom widgets like selection app bars or item wrappers to achieve a full UX.
  • API is closely tied to standard GridView.builder patterns.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
final controller = DragSelectGridViewController();

DragSelectGridView(
  gridController: controller,
  itemCount: 20,
  itemBuilder: (context, index, selected) {
    return SelectableItem(
      index: index,
      selected: selected,
    );
  },
  gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
    maxCrossAxisExtent: 80,
  ),
);

Alternatives

Packages that do the same job and could replace drag_select_grid_view.