0 purchases
data filters
Features #
Converts your existing data into Filters.
Demo #
Demo Video
https://github.com/hussainint/DataFilters/assets/48062618/5ff0dcb1-2e9a-4d5e-9cb4-a1a93a131162
Usage #
Check out example code in /example folder.
Your main data must be arranged like below.
List<List> data = [
['red', 'dog', 'small', 'bark', 'pet'],
['green', 'cat', 'medium', 'meow', 'stray'],
['blue', 'fish', 'large', 'swim', 'pet'],
['red', 'cat', 'small', 'meow', 'stray'],
['yellow', 'dog', 'large', 'bark', 'pet'],
['green', 'fish', 'medium', 'swim', 'pet'],
['blue', 'dog', 'medium', 'bark', 'pet'],
['red', 'fish', 'large', 'swim', 'pet'],
['yellow', 'cat', 'small', 'meow', 'pet'],
['green', 'dog', 'small', 'bark', 'pet'],
['blue', 'cat', 'large', 'meow', 'pet'],
['red', 'fish', 'medium', 'swim', 'stray'],
['yellow', 'dog', 'medium', 'bark', 'pet'],
['green', 'fish', 'large', 'swim', 'stray'],
['blue', 'cat', 'small', 'meow', 'pet'],
['red', 'dog', 'small', 'bark', 'stray'],
['yellow', 'cat', 'medium', 'meow', 'pet'],
['green', 'fish', 'small', 'swim', 'stray'],
['blue', 'dog', 'large', 'bark', 'pet'],
['pink', 'cat', 'medium', 'meow', 'pet'],
];
List<String> titles = ['Color', 'Animal', 'Size', 'Sound', 'Type'];
copied to clipboard
Selected filters will be stored in form of index
List<int>? filterIndex;
copied to clipboard
This code builds a filters ui
DataFilters(
data: data,
/// pass your filter title here
filterTitle: titles,
/// enable animation
showAnimation: true,
/// get list of index of selected filter
recent_selected_data_index: (List<int>? index) {
setState(() {
filterIndex = index;
});
},
/// styling
style: FilterStyle(
buttonColor: Colors.green,
buttonColorText: Colors.white,
filterBorderColor: Colors.grey,
),
),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.