diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 90211d07..98aa9782 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -19,6 +19,7 @@ 🐞 Fixed - [[#659]](https://github.com/GetStream/stream-chat-flutter/issues/659) Fixed unread count not updating correctly. +- Fix `Filter.empty()` json encoding. ## 2.2.1 diff --git a/packages/stream_chat/lib/src/core/models/filter.dart b/packages/stream_chat/lib/src/core/models/filter.dart index d5a2c08f..ca494bdb 100644 --- a/packages/stream_chat/lib/src/core/models/filter.dart +++ b/packages/stream_chat/lib/src/core/models/filter.dart @@ -104,7 +104,7 @@ class Filter extends Equatable { /// An empty filter const Filter.empty() - : value = const {}, + : value = const {}, operator = null, key = null; diff --git a/packages/stream_chat/test/src/core/models/filter_test.dart b/packages/stream_chat/test/src/core/models/filter_test.dart index a62c162e..e396c2b3 100644 --- a/packages/stream_chat/test/src/core/models/filter_test.dart +++ b/packages/stream_chat/test/src/core/models/filter_test.dart @@ -226,6 +226,12 @@ void main() { json.encode(value), ); }); + + test('empty', () { + const filter = Filter.empty(); + final encoded = json.encode(filter); + expect(encoded, '{}'); + }); }); test('groupedFilter', () {