Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpnurmi/item_selector
Item Selector for Flutter
https://github.com/jpnurmi/item_selector
dart flutter gridview listview selection
Last synced: 24 days ago
JSON representation
Item Selector for Flutter
- Host: GitHub
- URL: https://github.com/jpnurmi/item_selector
- Owner: jpnurmi
- License: other
- Created: 2020-05-02T13:47:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T13:35:37.000Z (7 months ago)
- Last Synced: 2024-08-23T23:54:06.403Z (2 months ago)
- Topics: dart, flutter, gridview, listview, selection
- Language: Dart
- Homepage: https://pub.dev/packages/item_selector
- Size: 521 KB
- Stars: 4
- Watchers: 2
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Item Selector for Flutter
[![pub](https://img.shields.io/pub/v/item_selector.svg)](https://pub.dev/packages/item_selector)
[![license: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![build](https://github.com/jpnurmi/item_selector/workflows/build/badge.svg)
[![codecov](https://codecov.io/gh/jpnurmi/item_selector/branch/main/graph/badge.svg)](https://codecov.io/gh/jpnurmi/item_selector)A generic [Flutter](https://flutter.dev) item selector that works with
ListView, GridView, Row, Column, or basically any parent widget that
can have indexed child widgets. It supports single-selection by tap,
and multi-selection by long-press and drag with auto-scrolling.## Preview
| ListView | GridView |
|:---:|:---:|
| ![ListView](https://raw.githubusercontent.com/jpnurmi/item_selector/master/doc/images/listview.gif "ListView") | ![GridView](https://raw.githubusercontent.com/jpnurmi/item_selector/master/doc/images/gridview.gif "GridView") || Column | Custom |
|:---:|:---:|
| ![Column](https://raw.githubusercontent.com/jpnurmi/item_selector/master/doc/images/column.gif "Column") | ![Custom](https://raw.githubusercontent.com/jpnurmi/item_selector/master/doc/images/custom.gif "Custom") |## Usage
To use this package, add `item_selector` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
```dart
ItemSelectionController(
child: ListView(
children: List.generate(10, (int index) {
return ItemSelectionBuilder(
index: index,
builder: (BuildContext context, int index, bool selected) {
return Text('$index: $selected');
},
);
}),
),
)
```## Thanks
Item Selector is based on [Multi Select GridView in Flutter - by Simon Lightfoot](https://gist.github.com/slightfoot/a002dd1e031f5f012f810c6d5da14a11).