Merge branch 'develop' into feat/channel-list-mutable-filters

This commit is contained in:
Sahil Kumar
2022-08-16 15:47:38 +05:30
committed by GitHub
3 changed files with 16 additions and 12 deletions
@@ -4,6 +4,8 @@
- [#1269](https://github.com/GetStream/stream-chat-flutter/issues/1269)
Fix `ChannelListEventHandler` castError at PagedValue.asSuccess.
- [#1241](https://github.com/GetStream/stream-chat-flutter/issues/1241) StreamChannelListView load
more indicator non stop.
✅ Added
@@ -190,13 +190,14 @@ class StreamChannelListController extends PagedValueNotifier<int, Channel> {
return super.refresh(resetValue: resetValue);
}
/// Replaces the previously loaded channels with [channels] and updates
/// the nextPageKey.
/// Replaces the previously loaded channels with the passed [channels].
set channels(List<Channel> channels) {
value = PagedValue(
items: channels,
nextPageKey: channels.length,
);
if (value.isSuccess) {
final currentValue = value.asSuccess;
value = currentValue.copyWith(items: channels);
} else {
value = PagedValue(items: channels);
}
}
/// Returns/Creates a new Channel and starts watching it.
@@ -153,12 +153,13 @@ class StreamUserListController extends PagedValueNotifier<int, User> {
return super.refresh(resetValue: resetValue);
}
/// Replaces the previously loaded users with [users] and updates
/// the nextPageKey.
/// Replaces the previously loaded users with the passed [users].
set users(List<User> users) {
value = PagedValue(
items: users,
nextPageKey: users.length,
);
if (value.isSuccess) {
final currentValue = value.asSuccess;
value = currentValue.copyWith(items: users);
} else {
value = PagedValue(items: users);
}
}
}