From ea3d10646e578991eb58ac3ddcde85d3d3bcf8ae Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Wed, 15 Sep 2021 16:02:05 +0530 Subject: [PATCH] feat(ui, core): Add default empty filter in `UserListView`. Signed-off-by: xsahil03x --- packages/stream_chat_flutter/lib/src/user_list_view.dart | 3 ++- packages/stream_chat_flutter_core/lib/src/user_list_core.dart | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/user_list_view.dart b/packages/stream_chat_flutter/lib/src/user_list_view.dart index 4d650192..12dbb3ec 100644 --- a/packages/stream_chat_flutter/lib/src/user_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/user_list_view.dart @@ -48,7 +48,7 @@ class UserListView extends StatefulWidget { /// Instantiate a new UserListView const UserListView({ Key? key, - this.filter, + this.filter = const Filter.empty(), this.sort, this.presence, this.pagination = const PaginationParams(limit: 30), @@ -76,6 +76,7 @@ class UserListView extends StatefulWidget { /// The query filters to use. /// You can query on any of the custom fields you've defined on the [Channel]. /// You can also filter other built-in channel fields. + // TODO: Make it non-nullable in a future breaking release final Filter? filter; /// The sorting used for the channels matching the filters. diff --git a/packages/stream_chat_flutter_core/lib/src/user_list_core.dart b/packages/stream_chat_flutter_core/lib/src/user_list_core.dart index 06ad7d80..75fc7411 100644 --- a/packages/stream_chat_flutter_core/lib/src/user_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/user_list_core.dart @@ -63,7 +63,7 @@ class UserListCore extends StatefulWidget { required this.loadingBuilder, required this.listBuilder, Key? key, - this.filter, + this.filter = const Filter.empty(), this.sort, this.presence, this.pagination = const PaginationParams(limit: 30), @@ -91,6 +91,7 @@ class UserListCore extends StatefulWidget { /// The query filters to use. /// You can query on any of the custom fields you've defined on the [Channel]. /// You can also filter other built-in channel fields. + // TODO: Make it non-nullable in a future breaking release final Filter? filter; /// The sorting used for the channels matching the filters.