All Projects → hcbpassos → Drag_select_grid_view

hcbpassos / Drag_select_grid_view

Licence: bsd-2-clause
A grid that supports both dragging and tapping to select its items.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Drag select grid view

ngx-widget-grid
Angular 2.x or in general ng-x module for dashboards
Stars: ✭ 65 (-35%)
Mutual labels:  widget, grid
Ka Table
Lightweight MIT React Table component for both TS and JS with Sorting, Filtering, Grouping, Virtualization, Editing and many more
Stars: ✭ 117 (+17%)
Mutual labels:  widget, grid
Vue Grid Layout
A draggable and resizable grid layout, for Vue.js.
Stars: ✭ 5,170 (+5070%)
Mutual labels:  widget, grid
yii2-grid-view-library
Highly enhanced GridView widget and grid components for Yii2
Stars: ✭ 57 (-43%)
Mutual labels:  widget, grid
vue-smart-widget
🗃️Smart widget is a flexible and extensible content container component for Vue2.x / Vue3.x in Next branch.
Stars: ✭ 110 (+10%)
Mutual labels:  widget, grid
Tabulator
Interactive Tables and Data Grids for JavaScript
Stars: ✭ 4,329 (+4229%)
Mutual labels:  widget, grid
Flutter graphite
Flutter widget to draw interactive direct graphs (flowcharts) of any complexity in a tile rectangular manner.
Stars: ✭ 23 (-77%)
Mutual labels:  widget, grid
Django Searchable Select
A better and faster multiple selection widget with suggestions
Stars: ✭ 92 (-8%)
Mutual labels:  widget
Griz
Grid library for React; Rescue the cat
Stars: ✭ 99 (-1%)
Mutual labels:  grid
Dev Widget
Unofficial Widget/profile card for https://dev.to/
Stars: ✭ 91 (-9%)
Mutual labels:  widget
Jquery Youtube Channels Playlist
jQuery plugin youtube playlist
Stars: ✭ 90 (-10%)
Mutual labels:  widget
Gaphas
Gaphas is the diagramming widget library for Python.
Stars: ✭ 91 (-9%)
Mutual labels:  widget
React Sortable Hoc
A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️
Stars: ✭ 9,747 (+9647%)
Mutual labels:  grid
Iconshowcase
Full-of-features, easy-to-customize, free and open source, Material Design dashboard for icon packs.
Stars: ✭ 91 (-9%)
Mutual labels:  widget
React Autocomplete Input
Autocomplete input field for React
Stars: ✭ 100 (+0%)
Mutual labels:  widget
Awesomecard
A Flutter package to easily create a Credit Card in your application.
Stars: ✭ 91 (-9%)
Mutual labels:  widget
Re Jok
A React UI Component library built with styled-components
Stars: ✭ 102 (+2%)
Mutual labels:  grid
Angular Generic Table
A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
Stars: ✭ 100 (+0%)
Mutual labels:  grid
React Photo Layout Editor
Photo layout editor for react
Stars: ✭ 96 (-4%)
Mutual labels:  grid
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (-5%)
Mutual labels:  grid

drag_select_grid_view

Pub package CI workflow Awesome style: effective dart

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

Selecting

Basic usage

First of all, DragSelectGridView constructor is very similar to GridView.builder, so you should take your time to understand the latter before diving into this library.

Once you are familiar with GridView.builder, probably the only additional piece of information you'll need is DragSelectGridViewController. With it, you're able to know which indexes are selected.

Check this example:

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final controller = DragSelectGridViewController();

  @override
  void initState() {
    super.initState();
    controller.addListener(scheduleRebuild);
  }

  @override
  void dispose() {
    controller.removeListener(scheduleRebuild);
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: SelectionAppBar(
        selection: controller.value,
      ),
      body: DragSelectGridView(
        gridController: controller,
        itemCount: 20,
        itemBuilder: (context, index, selected) {
          return SelectableItem(
            index: index,
            selected: selected,
          );
        },
        gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
          maxCrossAxisExtent: 80,
        ),
      ),
    );
  }

  void scheduleRebuild() => setState(() {});
}

As you may have noticed in the code above, DragSelectGridView must be used along two other widgets in order to provide a proper user experience. In the example, they are:

  • SelectableItem: A selectable widget, which is going to visually indicate whether the item is selected or not.

  • SelectionAppBar: A custom AppBar, which shows the amount of selected items and an option to unselect them.

The example project provides some samples of those widgets. I won't add them to the library, since they are unrelated to the grid itself, but feel free to copy them into your project, as long as you respect the license terms.

Advanced usage

You can use the setter DragSelectGridViewController.value to directly change the selection (I'm not quite sure why you'd need this, but I don't ask questions).

It allows this sort of interaction:

Directly changing selection

You can check the code here.

There are some other minor settings you can do to make DragSelectGridView fit your needs, like DragSelectGridView.autoScrollHotspotHeight and DragSelectGridView.unselectOnWillPop. Those features are well documented, so I'll let you take your discovery time.

Hopefully, this is everything you need to know to use this library.

Thanks ❤️

Once upon a time I asked at Flutter Study Group how to implement a specific feature that I intended to add to this library. Simon Lightfoot offered to help me and effortlessly implemented what eventually became part of this library (check this gist). A big thanks to him.

I took a lot of inspiration from Aidan Follestad's Android implementation, drag-select-recyclerview. Also a big thanks to him.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].