zeba_academy_selection 1.0.0
zeba_academy_selection: ^1.0.0 copied to clipboard
A lightweight Flutter selection package with single select, multi select, toggle selection, select all and clear selection.
zeba_academy_selection ๐ฏ #
A lightweight and reusable Flutter selection management package that provides powerful selection utilities including single selection, multi selection, toggle selection, select all, and clear selection.
Built with โค๏ธ for Flutter developers by Zeba Academy.
โจ Features #
zeba_academy_selection provides simple and flexible selection handling for Flutter applications.
Available Features #
โ Single selection โ Multi selection โ Toggle selection โ Select all items โ Clear selections โ Remove selected items โ Generic type support โ Null safety support โ Lightweight and dependency free โ Controller-based architecture
๐ Installation #
Add the package to your pubspec.yaml file:
dependencies:
zeba_academy_selection: ^1.0.0
Run:
flutter pub get
๐ Usage #
Single Selection #
Create a selection controller:
final controller = SelectionController<String>();
Use the single selection widget:
ZebaSingleSelection<String>(
items: [
"Flutter",
"Dart",
"Firebase",
],
controller: controller,
builder: (context, item, selected) {
return ListTile(
title: Text(item),
trailing: selected
? const Icon(Icons.check)
: null,
);
},
);
Multiple Selection #
Create a multi-selection controller:
final controller = MultiSelectionController<String>();
Use:
ZebaMultiSelection<String>(
items: [
"Flutter",
"Dart",
"Firebase",
],
controller: controller,
builder: (context, item, selected) {
return CheckboxListTile(
title: Text(item),
value: selected,
onChanged: null,
);
},
);
๐ฏ Controller APIs #
SelectionController #
Used for handling single selection.
Select Item #
controller.select("Flutter");
Check Selection #
controller.isSelected("Flutter");
Toggle Selection #
controller.toggle("Flutter");
Clear Selection #
controller.clear();
MultiSelectionController #
Used for handling multiple selections.
Add Selection #
controller.select("Flutter");
Remove Selection #
controller.remove("Flutter");
Toggle Selection #
controller.toggle("Flutter");
Select All #
controller.selectAll([
"Flutter",
"Dart",
"Firebase",
]);
Clear All #
controller.clear();
๐ก Use Cases #
This package is useful for:
- Category selection
- Filter chips
- Tags selection
- Multi-choice forms
- Permission selection
- Interest selection
- Product filtering
- Quiz options
- Dashboard filters
- Settings screens
๐ Package Structure #
lib/
โ
โโโ zeba_academy_selection.dart
โ
โโโ src/
โ
โโโ selection_controller.dart
โโโ multi_selection.dart
โโโ single_selection.dart
โโโ selection_group.dart
๐งช Testing #
Run package tests:
flutter test
Analyze the package:
flutter analyze
Check publishing:
flutter pub publish --dry-run
๐ Why Zeba Academy Packages? #
Zeba Academy Flutter packages are created with:
- Clean and simple APIs
- Developer-friendly architecture
- Production-ready code
- Easy integration
- Open-source learning approach
๐จโ๐ป About Me #
โจ Iโm Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.
You can learn more about me and my work at:
or connect with me on LinkedIn:
https://www.linkedin.com/in/sufyanism
๐ Your all-in-one learning hub! #
Zeba Academy is a learning platform dedicated to coding, technology, and development.
Explore courses, tutorials, and practical resources designed to help developers build real-world skills.
โก Main website:
โก Coding courses and resources:
โก YouTube tutorials:
https://www.youtube.com/@zeba.academy
โก Instagram:
https://www.instagram.com/zeba.academy/
๐ License #
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to:
โ Use this package โ Study the source code โ Modify the package โ Share improvements
Any distributed modified version must also be released under the same GPL-3.0 license.
Full license:
https://www.gnu.org/licenses/gpl-3.0.html
โค๏ธ Support #
If you find this package useful:
โญ Star the project ๐ข Share it with Flutter developers ๐ค Contribute improvements
Thank you for visiting!
Built with โค๏ธ by Zeba Academy