flutter_selectable_list 0.0.1 copy "flutter_selectable_list: ^0.0.1" to clipboard
flutter_selectable_list: ^0.0.1 copied to clipboard

A widget library that provides an intuitive solution to build and manage selectable lists.

Flutter Selectable List #

A widget library that provides an intuitive solution to build and manage selectable lists.

Placeholder
SelectableListAnchor

Features #

  • Supports single or multi select
  • Modal widgets (BottomSheet, Dialog, Dropdown, SideSheet) that contain a SelectableList
  • SelectableListAnchor - build an anchor widget, open any type of modal widget
  • Easily maintain the list of selected items from anywhere with a SelectableListController

Usage #

SelectableList #

A customizable ListView that listens to a SelectableListController. Instantiated with either a single or multi constructor. By default, the items are shown as a list of CheckboxListTiles.

SelectableListController #

A ChangeNotifier that maintains the list of items and its selected value. It contains properties to determine the loading and search states, and can also be used to open modal widgets when paired with a SelectableListAnchor.

  • ListSelectBottomSheet
  • ListSelectDialog
  • ListSelectDropdown
  • ListSelectSideSheet

All modal widgets contain a SelectableList. They provide default header and actions widgets.

showModalBottomSheet(
  context: context,
  isScrollControlled: true,
  builder: (context) {
    return ListSelectBottomSheet.multi(
      controller: _controller,
      itemTitle: (e) => e.name,
    );
  },
);

Top-level functions showModalDropdown and showModalSideSheet are included as part of the package. These can be used for general purposes.

SelectableListAnchor #

A builder widget that can be used to open any of the modal widgets. Any properties specific to a certain modal widget can be specified with the respective parameter. For example, if the anchor is opening a SideSheet, the parameter sideSheetProperties can be provided.

This widget is also a FormField.

SelectableListAnchor.multi(
  items: [],
  sideSheetProperties: const SideSheetProperties(
    direction: TextDirection.rtl,
  ),
  builder: (controller, formFieldState) {
    return TextButton(
      onPressed: () => controller.openSideSheet(),
      child: const Text('Open SideSheet'),
    );
  },
);

Contributing #

Pull requests are welcome. If you are interested in becoming a ${\color{lightgreen}collaborator}$, please send an email.

3
likes
0
points
180
downloads

Publisher

verified publisherchrisb.dev

Weekly Downloads

A widget library that provides an intuitive solution to build and manage selectable lists.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_selectable_list