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
@@ -1327,7 +1327,7 @@ class ChannelClientState {
/// This flag should be managed by UI sdks.
/// When false, any new message (received by WebSocket event
/// - [EventType.messageNew]) will not be pushed on to message list.
bool get isUpToDate => _isUpToDateController.value ?? true;
bool get isUpToDate => _isUpToDateController.value;
set isUpToDate(bool isUpToDate) => _isUpToDateController.add(isUpToDate);
@@ -1428,7 +1428,7 @@ class ChannelClientState {
}
if (_countMessageAsUnread(message)) {
_unreadCountController.add(_unreadCountController.value! + 1);
_unreadCountController.add(_unreadCountController.value + 1);
}
}));
}
@@ -1666,13 +1666,13 @@ class ChannelClientState {
a.createdAt.compareTo(b.createdAt);
/// The channel state related to this client
ChannelState get _channelState => _channelStateController.value!;
ChannelState get _channelState => _channelStateController.value;
/// The channel state related to this client as a stream
Stream<ChannelState> get channelStateStream => _channelStateController.stream;
/// The channel state related to this client
ChannelState get channelState => _channelStateController.value!;
ChannelState get channelState => _channelStateController.value;
late BehaviorSubject<ChannelState> _channelStateController;
final Debounce _debouncedUpdatePersistenceChannelState;
@@ -1684,7 +1684,7 @@ class ChannelClientState {
/// The channel threads related to this channel
Map<String, List<Message>> get threads =>
_threadsController.value!.map((key, value) => MapEntry(key, value));
_threadsController.value.map((key, value) => MapEntry(key, value));
/// The channel threads related to this channel as a stream
Stream<Map<String, List<Message>>> get threadsStream =>
@@ -1701,7 +1701,7 @@ class ChannelClientState {
}
/// Channel related typing users last value
List<User> get typingEvents => _typingEventsController.value!;
List<User> get typingEvents => _typingEventsController.value;
/// Channel related typing users stream
Stream<List<User>> get typingEventsStream => _typingEventsController.stream;
+9 -6
View File
@@ -1248,7 +1248,10 @@ class StreamChatClient {
);
}
return updateMessage(
message.copyWith(pinned: true, pinExpires: pinExpires),
message.copyWith(
pinned: true,
pinExpires: pinExpires,
),
);
}
@@ -1388,25 +1391,25 @@ class ClientState {
void updateUser(User? user) => updateUsers([user]);
/// The current user
OwnUser? get user => _userController.value;
OwnUser? get user => _userController.valueOrNull;
/// The current user as a stream
Stream<OwnUser?> get userStream => _userController.stream;
/// The current user
Map<String, User> get users => _usersController.value!;
Map<String, User> get users => _usersController.value;
/// The current user as a stream
Stream<Map<String, User>> get usersStream => _usersController.stream;
/// The current unread channels count
int? get unreadChannels => _unreadChannelsController.value;
int? get unreadChannels => _unreadChannelsController.valueOrNull;
/// The current unread channels count as a stream
Stream<int?> get unreadChannelsStream => _unreadChannelsController.stream;
/// The current total unread messages count
int? get totalUnreadCount => _totalUnreadCountController.value;
int? get totalUnreadCount => _totalUnreadCountController.valueOrNull;
/// The current total unread messages count as a stream
Stream<int?> get totalUnreadCountStream => _totalUnreadCountController.stream;
@@ -1415,7 +1418,7 @@ class ClientState {
Stream<Map<String, Channel>> get channelsStream => _channelsController.stream;
/// The current list of channels in memory
Map<String, Channel> get channels => _channelsController.value!;
Map<String, Channel> get channels => _channelsController.value;
set channels(Map<String, Channel> channelMap) {
final newChannels = {...channels, ...channelMap};