https://github.com/taimoorhassan/multiselect
A simple DropDown widget with multiselect enabled by default
https://github.com/taimoorhassan/multiselect
flutter flutterwidgets
Last synced: 5 months ago
JSON representation
A simple DropDown widget with multiselect enabled by default
- Host: GitHub
- URL: https://github.com/taimoorhassan/multiselect
- Owner: TaimoorHassan
- License: bsd-3-clause
- Created: 2021-06-02T11:57:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T14:28:03.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T02:51:41.453Z (12 months ago)
- Topics: flutter, flutterwidgets
- Language: C++
- Homepage: https://pub.dev/packages/multiselect
- Size: 303 KB
- Stars: 10
- Watchers: 1
- Forks: 66
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# multiselect
### A simple Multiselect Dropdown

# Usage
add it to `pubspec.yaml`
``` yaml
dependencies:
flutter:
sdk: flutter
multiselect: # use latest version
```
import it
``` dart
// Imports all Widgets included in [multiselect] package
import 'package:multiselect/multiselect.dart';
```
Add the `DropDownMultiSelect` widget to your build method
``` dart
// Import multiselct
import 'package:multiselect/multiselect.dart';
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State {
List selected = [];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(20.0),
// DropDownMultiSelect comes from multiselect
child: DropDownMultiSelect(
onChanged: (List x) {
setState(() {
selected =x;
});
},
options: ['a' , 'b' , 'c' , 'd'],
selectedValues: selected,
whenEmpty: 'Select Something',
),
),
));
}
}
```
And that is it. You will have a working multiselect DropDown with no effort at all.
\
\
\
>PS: multiselect is planned to be a collection of multi-select widgets. I will add other functionality based on the needs of the community