refactor(llc): make Filter.empty constructor const.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-09-15 16:01:00 +05:30
committed by xsahil03x
parent d65481533a
commit 59aad47789
2 changed files with 7 additions and 4 deletions
@@ -102,6 +102,12 @@ class Filter extends Equatable {
this.key,
}) : operator = operator.rawValue;
/// An empty filter
const Filter.empty()
: value = const {},
operator = null,
key = null;
/// Combines the provided filters and matches the values
/// matched by all filters.
factory Filter.and(List<Filter> filters) =>
@@ -172,9 +178,6 @@ 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
@@ -139,7 +139,7 @@ void main() {
});
test('empty', () {
final filter = Filter.empty();
const filter = Filter.empty();
expect(filter.value, {});
});