Merge branch 'develop' into fix/message-search-pagination

This commit is contained in:
Sahil Kumar
2021-09-08 15:51:33 +05:30
committed by GitHub
49 changed files with 1433 additions and 321 deletions
@@ -51,6 +51,9 @@ enum FilterOperator {
/// Matches none of the values specified in an array.
nor,
/// Matches any list that contains the specified value
contains,
}
/// Helper extension for [FilterOperator]
@@ -71,6 +74,7 @@ extension FilterOperatorX on FilterOperator {
FilterOperator.and: '\$and',
FilterOperator.or: '\$or',
FilterOperator.nor: '\$nor',
FilterOperator.contains: '\$contains',
}[this]!;
}
@@ -157,6 +161,10 @@ class Filter extends Equatable {
factory Filter.exists(String key, {bool exists = true}) =>
Filter._(operator: FilterOperator.exists, key: key, value: exists);
/// Matches any list that contains the specified values
factory Filter.contains(String key, Object value) =>
Filter._(operator: FilterOperator.contains, key: key, value: value);
/// Creates a custom [Filter] if there isn't one already available.
const factory Filter.custom({
required Object value,
@@ -164,6 +172,9 @@ class Filter extends Equatable {
String? key,
}) = Filter.__;
/// An empty filter
factory Filter.empty() => const Filter.raw(value: {});
/// Creates a custom [Filter] from a raw map value
///
/// ```dart