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,
|
||||
}) : 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, {});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user