Merge pull request #179 from GetStream/feature/channelListView
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
## 0.2.17+2
|
||||
|
||||
- Expose ChannelsBloc.channelsComparator to sort channels on message.new event
|
||||
|
||||
## 0.2.17+1
|
||||
|
||||
- Fix mention tap bug
|
||||
|
||||
@@ -14,11 +14,15 @@ class ChannelsBloc extends StatefulWidget {
|
||||
/// Set this to true to prevent channels to be brought to the top of the list when a new message arrives
|
||||
final bool lockChannelsOrder;
|
||||
|
||||
/// Comparator used to sort the channels when a message.new event is received
|
||||
final Comparator<Channel> channelsComparator;
|
||||
|
||||
/// Instantiate a new ChannelsBloc
|
||||
const ChannelsBloc({
|
||||
Key key,
|
||||
this.child,
|
||||
this.lockChannelsOrder = false,
|
||||
this.channelsComparator,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -141,6 +145,10 @@ class ChannelsBlocState extends State<ChannelsBloc>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (widget.channelsComparator != null) {
|
||||
newChannels.sort(widget.channelsComparator);
|
||||
}
|
||||
_channelsController.add(newChannels);
|
||||
}));
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
name: stream_chat_flutter
|
||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
||||
version: 0.2.17+1
|
||||
version: 0.2.17+2
|
||||
repository: https://github.com/GetStream/stream-chat-flutter
|
||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||
|
||||
|
||||
Reference in New Issue
Block a user