Represents a filter group, it is defined by a Set of Filters and a groupID.
Facet filter group
Create a filter group of FilterFacet filters using facet
final filterGroup = FilterGroup.facet(
name: 'colors',
filters: {
Filter.facet('color', 'red'),
Filter.facet('color', 'blue'),
},
operator: FilterOperator.and,
);
Tag filter group
Create a filter group of FilterTag filters using tag
final filterGroup = FilterGroup.tag(
operator: FilterOperator.or,
filters: {
Filter.tag('fantasy'),
Filter.tag('comedy'),
},
);
Numeric filter group
Create a filter group of FilterNumeric filters using numeric
final filterGroup = FilterGroup.numeric(
name: 'products',
operator: FilterOperator.and,
filters: {
Filter.range('rating', lowerBound: 3, upperBound: 5),
Filter.comparison('price', NumericOperator.lessOrEquals, 100),
},
);
Hierarchical filter group
Create a filter group of hierarchical filters using hierarchical
final group = FilterGroup.hierarchical(
name: 'categories',
attributes: [
'category.lvl0',
'category.lvl1',
],
path: [
Filter.facet('category.lvl0', 'Shoes'),
Filter.facet('category.lvl1', 'Shoes > Running'),
],
filters: {Filter.facet('category.lvl1', 'Shoes > Running')},
);
- Implemented types
-
- Set<
T>
- Set<
- Implementers
- Available Extensions
Constructors
Properties
- first → T
-
The first element.
no setterinherited
- groupID → FilterGroupID
-
Filter group ID (name and operator)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
T> -
An iterator that iterates over the elements of this set.
no setterinherited
- last → T
-
The last element.
no setterinherited
- length → int
-
The number of elements in this.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → T
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
Methods
-
add(
T value) → bool -
Adds
value
to the set.inherited -
addAll(
Iterable< T> elements) → void -
Adds all
elements
to this set.inherited -
any(
bool test(T element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
cast<
R> () → Set< R> -
Provides a view of this set as a set of
R
instances.inherited -
clear(
) → void -
Removes all elements from the set.
inherited
-
contains(
Object? value) → bool -
Whether
value
is in the set.inherited -
containsAll(
Iterable< Object?> other) → bool -
Whether this set contains all the elements of
other
.inherited -
copyWith(
{FilterGroupID? groupID, Set< T> ? filters}) → FilterGroup<T> - Create a copy with given parameters.
-
difference(
Set< Object?> other) → Set<T> -
Creates a new set with the elements of this that are not in
other
.inherited -
elementAt(
int index) → T -
Returns the
index
th element.inherited -
every(
bool test(T element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
expand<
T> (Iterable< T> toElements(T element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(T element), {T orElse()?}) → T -
The first element that satisfies the given predicate
test
.inherited -
fold<
T> (T initialValue, T combine(T previousValue, T element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< T> other) → Iterable<T> -
Creates the lazy concatenation of this iterable and
other
.inherited -
forEach(
void action(T element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
intersection(
Set< Object?> other) → Set<T> -
Creates a new set which is the intersection between this set and
other
.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(T element), {T orElse()?}) → T -
The last element that satisfies the given predicate
test
.inherited -
lookup(
Object? object) → T? -
If an object equal to
object
is in the set, return it.inherited -
map<
T> (T toElement(T e)) → Iterable< T> -
The current elements of this iterable modified by
toElement
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
T combine(T value, T element)) → T -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
Object? value) → bool -
Removes
value
from the set.inherited -
removeAll(
Iterable< Object?> elements) → void -
Removes each element of
elements
from this set.inherited -
removeWhere(
bool test(T element)) → void -
Removes all elements of this set that satisfy
test
.inherited -
retainAll(
Iterable< Object?> elements) → void -
Removes all elements of this set that are not elements in
elements
.inherited -
retainWhere(
bool test(T element)) → void -
Removes all elements of this set that fail to satisfy
test
.inherited -
singleWhere(
bool test(T element), {T orElse()?}) → T -
The single element that satisfies
test
.inherited -
skip(
int count) → Iterable< T> -
Creates an Iterable that provides all but the first
count
elements.inherited -
skipWhile(
bool test(T value)) → Iterable< T> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.inherited -
take(
int count) → Iterable< T> -
Creates a lazy iterable of the
count
first elements of this iterable.inherited -
takeWhile(
bool test(T value)) → Iterable< T> -
Creates a lazy iterable of the leading elements satisfying
test
.inherited -
toList(
{bool growable = true}) → List< T> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< T> -
Creates a Set with the same elements and behavior as this
Set
.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
union(
Set< T> other) → Set<T> -
Creates a new set which contains all the elements of this set and
other
.inherited -
where(
bool test(T element)) → Iterable< T> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test
.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
facet(
{required Set< FilterFacet> filters, String name = '', FilterOperator operator = FilterOperator.and}) → FacetFilterGroup - Create a filter group of FilterFacet filters.
-
hierarchical(
{required Set< FilterFacet> filters, required List<FilterFacet> path, required List<String> attributes, String name = ''}) → HierarchicalFilterGroup - Create a filter group of hierarchical filters.
-
numeric(
{required Set< FilterNumeric> filters, String name = '', FilterOperator operator = FilterOperator.and}) → NumericFilterGroup - Create a filter group of FilterNumeric filters
-
tag(
{required Set< FilterTag> filters, String name = '', FilterOperator operator = FilterOperator.and}) → TagFilterGroup - Create a filter group of FilterTag filters