Merge branches 'develop' and 'ref/segregate-api-layer' of https://github.com/GetStream/stream-chat-flutter into ref/segregate-api-layer

 Conflicts:
	packages/stream_chat/lib/src/api/channel.dart
	packages/stream_chat/lib/src/client.dart
	packages/stream_chat_persistence/lib/src/db/moor_chat_database.g.dart
This commit is contained in:
Sahil Kumar
2021-05-27 20:07:11 +05:30
44 changed files with 753 additions and 188 deletions
@@ -71,7 +71,7 @@ class ChannelsBlocState extends State<ChannelsBloc>
}
/// The current channel list
List<Channel>? get channels => _channelsController.value;
List<Channel>? get channels => _channelsController.valueOrNull;
/// The current channel list as a stream
Stream<List<Channel>> get channelsStream => _channelsController.stream;
@@ -138,7 +138,7 @@ class ChannelsBlocState extends State<ChannelsBloc>
_channelsController.add(temp);
}
if (_channelsController.hasValue &&
_queryChannelsLoadingController.value!) {
_queryChannelsLoadingController.value) {
_queryChannelsLoadingController.sink.add(false);
}
}
@@ -44,7 +44,8 @@ class MessageSearchBlocState extends State<MessageSearchBloc>
late StreamChatCoreState _streamChatCoreState;
/// The current messages list
List<GetMessageResponse>? get messageResponses => _messageResponses.value;
List<GetMessageResponse>? get messageResponses =>
_messageResponses.valueOrNull;
/// The current messages list as a stream
Stream<List<GetMessageResponse>> get messagesStream =>
@@ -93,8 +94,7 @@ class MessageSearchBlocState extends State<MessageSearchBloc>
final temp = oldMessages + messages.results;
_messageResponses.add(temp);
}
if (_messageResponses.hasValue &&
_queryMessagesLoadingController.value!) {
if (_messageResponses.hasValue && _queryMessagesLoadingController.value) {
_queryMessagesLoadingController.add(false);
}
} catch (e, stk) {
@@ -43,7 +43,7 @@ class UsersBloc extends StatefulWidget {
class UsersBlocState extends State<UsersBloc>
with AutomaticKeepAliveClientMixin {
/// The current users list
List<User>? get users => _usersController.value;
List<User>? get users => _usersController.valueOrNull;
/// The current users list as a stream
Stream<List<User>> get usersStream => _usersController.stream;
@@ -92,7 +92,7 @@ class UsersBlocState extends State<UsersBloc>
final temp = oldUsers + usersResponse.users;
_usersController.add(temp);
}
if (_usersController.hasValue && _queryUsersLoadingController.value!) {
if (_usersController.hasValue && _queryUsersLoadingController.value) {
_queryUsersLoadingController.add(false);
}
} catch (e, stk) {