refactor(llc): make Filter.empty constructor const.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -102,6 +102,12 @@ class Filter extends Equatable {
|
|||||||
this.key,
|
this.key,
|
||||||
}) : operator = operator.rawValue;
|
}) : operator = operator.rawValue;
|
||||||
|
|
||||||
|
/// An empty filter
|
||||||
|
const Filter.empty()
|
||||||
|
: value = const {},
|
||||||
|
operator = null,
|
||||||
|
key = null;
|
||||||
|
|
||||||
/// Combines the provided filters and matches the values
|
/// Combines the provided filters and matches the values
|
||||||
/// matched by all filters.
|
/// matched by all filters.
|
||||||
factory Filter.and(List<Filter> filters) =>
|
factory Filter.and(List<Filter> filters) =>
|
||||||
@@ -172,9 +178,6 @@ class Filter extends Equatable {
|
|||||||
String? key,
|
String? key,
|
||||||
}) = Filter.__;
|
}) = Filter.__;
|
||||||
|
|
||||||
/// An empty filter
|
|
||||||
factory Filter.empty() => const Filter.raw(value: {});
|
|
||||||
|
|
||||||
/// Creates a custom [Filter] from a raw map value
|
/// Creates a custom [Filter] from a raw map value
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('empty', () {
|
test('empty', () {
|
||||||
final filter = Filter.empty();
|
const filter = Filter.empty();
|
||||||
expect(filter.value, {});
|
expect(filter.value, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user