data_filters 0.0.3 copy "data_filters: ^0.0.3" to clipboard
data_filters: ^0.0.3 copied to clipboard

Add Filters to your existing data. Pass nested list of values and generate a filters for it.

Features #

Converts your existing data into Filters.

Demo #

Usage #

Check out example code in /example folder.

Your main data must be arranged like below.

List<List> data = [
    ['red', 'dog', 'small', 'bark'],
    ['green', 'cat', 'medium', 'meow'],
    ['blue', 'fish', 'large', 'swim'],
    ['red', 'cat', 'small', 'meow'],
    ['yellow', 'dog', 'large', 'bark'],
    ['green', 'fish', 'medium', 'swim'],
    ['blue', 'dog', 'medium', 'bark'],
    ['red', 'fish', 'large', 'swim'],
    ['yellow', 'cat', 'small', 'meow'],
    ['green', 'dog', 'small', 'bark'],
    ['blue', 'cat', 'large', 'meow'],
    ['red', 'fish', 'medium', 'swim'],
    ['yellow', 'dog', 'medium', 'bark'],
    ['green', 'fish', 'large', 'swim'],
    ['blue', 'cat', 'small', 'meow'],
    ['red', 'dog', 'small', 'bark'],
    ['yellow', 'cat', 'medium', 'meow'],
    ['green', 'fish', 'small', 'swim'],
    ['blue', 'dog', 'large', 'bark'],
    ['red', 'cat', 'medium', 'meow'],
  ];


Selected filters will be stored in form of index

List<int>? filterIndex;

This code builds a filters ui

        DataFilters(
            data: data,
            filterTitle: const ['Color', 'Animal', 'Size', 'Sound'],
            recent_selected_data_index: (List<int>? index) {
              setState(() {
                filterIndex = index;
              });
            },
            style: FilterStyle(
              buttonColor: Colors.red,
              filterBorderColor: Colors.grey,
            ),
          ),
5
likes
140
points
77
downloads

Publisher

unverified uploader

Weekly Downloads

Add Filters to your existing data. Pass nested list of values and generate a filters for it.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on data_filters