Filter class
Stream supports a limited set of filters for querying channels, users and members. The example below shows how to filter for channels of type messaging where the current user is a member
final filter = Filter.and(
Filter.equal('type', 'messaging'),
Filter.in_('members', [user.id])
)
Constructors
-
Filter.and(List<
Filter> filters) -
Combines the provided filters and matches the values
matched by all filters.
factory
- Filter.autoComplete(String key, String text)
-
Matches values with the specified prefix.
factory
- Filter.contains(String key, Object value)
-
Matches any list that contains the specified values
factory
- Filter.custom({required Object value, String? operator, String? key})
-
Creates a custom Filter if there isn't one already available.
constfactory
- Filter.empty()
-
An empty filter
const
- Filter.equal(String key, Object value)
-
Matches values that are equal to a specified value.
factory
- Filter.exists(String key, {bool exists = true})
-
Matches values that exist/don't exist based on the specified boolean value.
factory
- Filter.greater(String key, Object value)
-
Matches values that are greater than a specified value.
factory
- Filter.greaterOrEqual(String key, Object value)
-
Matches values that are greater than a specified value.
factory
-
Filter.in_(String key, List<
Object> values) -
Matches any of the values specified in an array.
factory
- Filter.less(String key, Object value)
-
Matches values that are less than a specified value.
factory
- Filter.lessOrEqual(String key, Object value)
-
Matches values that are less than or equal to a specified value.
factory
-
Filter.nor(List<
Filter> filters) -
Combines the provided filters and matches the values
not matched by all the filters.
factory
- Filter.notEqual(String key, Object value)
-
Matches all values that are not equal to a specified value.
factory
- Filter.notExists(String key)
-
Matches values that don't exist.
factory
-
Filter.notIn(String key, List<
Object> values) -
Matches none of the values specified in an array.
factory
-
Filter.or(List<
Filter> filters) -
Combines the provided filters and matches the values
matched by at least one of the filters.
factory
- Filter.query(String key, String text)
-
Matches values by performing text search with the specified value.
factory
-
Filter.raw({required Map<
String, Object?> value}) -
Creates a custom Filter from a raw map value
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String?
-
The "left-hand" side of the filter.
Specifies the name of the field the filter should match.
final
- operator → String?
-
An operator used for the filter. The operator string must start with
$
final -
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, thetoString
method will be overridden to output this instance'sprops
.no setterinherited - value → Object
-
The "right-hand" side of the filter.
Specifies the value the filter should match.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - Serializes to json object
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited