diff --git a/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart b/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart index 393c3686..b77ef394 100644 --- a/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/channel_list_core.dart @@ -66,7 +66,11 @@ class ChannelListCore extends StatefulWidget { this.sort, this.pagination, this.channelListController, - }) : super(key: key); + }) : assert(errorBuilder != null), + assert(emptyBuilder != null), + assert(loadingBuilder != null), + assert(listBuilder != null), + super(key: key); /// A [ChannelListController] allows reloading and pagination. /// Use [ChannelListController.loadData] and [ChannelListController.paginateData] respectively for reloading and pagination. diff --git a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart index 987e06f9..7009234b 100644 --- a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart @@ -23,7 +23,8 @@ class ChannelsBloc extends StatefulWidget { this.lockChannelsOrder = false, this.channelsComparator, this.shouldAddChannel, - }) : super(key: key); + }) : assert(child != null), + super(key: key); /// The widget child final Widget child; diff --git a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart index 5856575c..64e8f255 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_list_core.dart @@ -54,17 +54,21 @@ import 'stream_channel.dart'; /// The widget uses a [ListView.custom] to render the list of channels. /// class MessageListCore extends StatefulWidget { - /// Instantiate a new [MessageListView] + /// Instantiate a new [MessageListView]. MessageListCore({ Key key, - this.showScrollToBottom = true, - this.parentMessage, @required this.loadingBuilder, @required this.emptyBuilder, @required this.messageListBuilder, @required this.errorWidgetBuilder, + this.showScrollToBottom = true, + this.parentMessage, this.messageListController, - }) : super(key: key); + }) : assert(loadingBuilder != null), + assert(emptyBuilder != null), + assert(messageListBuilder != null), + assert(errorWidgetBuilder != null), + super(key: key); /// A [MessageListController] allows pagination. /// Use [ChannelListController.paginateData] pagination. diff --git a/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart b/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart index a6a73012..6458bebf 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_search_bloc.dart @@ -16,7 +16,8 @@ class MessageSearchBloc extends StatefulWidget { const MessageSearchBloc({ Key key, @required this.child, - }) : super(key: key); + }) : assert(child != null), + super(key: key); /// The widget child final Widget child; diff --git a/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart b/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart index 26ee58c1..e3d98426 100644 --- a/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/message_search_list_core.dart @@ -50,7 +50,11 @@ class MessageSearchListCore extends StatefulWidget { this.paginationParams, this.messageFilters, this.messageSearchListController, - }) : super(key: key); + }) : assert(emptyBuilder != null), + assert(errorBuilder != null), + assert(loadingBuilder != null), + assert(childBuilder != null), + super(key: key); /// A [MessageSearchListController] allows reloading and pagination. /// Use [MessageSearchListController.loadData] and [MessageSearchListController.paginateData] respectively for reloading and pagination. diff --git a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart index d454d8c9..fbdc6d86 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart @@ -40,7 +40,9 @@ class StreamChatCore extends StatefulWidget { Key key, @required this.client, @required this.child, - }) : super(key: key); + }) : assert(client != null), + assert(child != null), + super(key: key); /// Instance of Stream Chat Client containing information about the current /// application. 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 a9398d89..23140258 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 @@ -50,7 +50,6 @@ import 'package:stream_chat_flutter_core/src/users_bloc.dart'; /// [UsersBloc] must be the ancestor of this widget. This is necessary since /// [UserListCore] depends on functionality contained within [UsersBloc]. /// -/// The widget uses a [ListView.separated], [GridView.builder] to render the list, grid of channels. /// The parameters [listBuilder], [loadingBuilder], [emptyBuilder] and [errorBuilder] must all be supplied /// and not null. class UserListCore extends StatefulWidget { @@ -67,7 +66,11 @@ class UserListCore extends StatefulWidget { this.pagination, this.groupAlphabetically = false, this.userListController, - }) : super(key: key); + }) : assert(errorBuilder != null), + assert(emptyBuilder != null), + assert(loadingBuilder != null), + assert(listBuilder != null), + super(key: key); /// A [UserListController] allows reloading and pagination. /// Use [UserListController.loadData] and [UserListController.paginateData] respectively for reloading and pagination. diff --git a/packages/stream_chat_flutter_core/lib/src/users_bloc.dart b/packages/stream_chat_flutter_core/lib/src/users_bloc.dart index 359985b3..19c4a026 100644 --- a/packages/stream_chat_flutter_core/lib/src/users_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/users_bloc.dart @@ -16,7 +16,8 @@ class UsersBloc extends StatefulWidget { const UsersBloc({ Key key, @required this.child, - }) : super(key: key); + }) : assert(child != null), + super(key: key); /// The widget child final Widget child;