feat: Add support for messages filter in MessageListView and MessageListCore (#303)

* [MessageListView, MessageListCore] Add support for message filter

Signed-off-by: Sahil Kumar <[email protected]>

* [UI-Kit -> Pubspec] Remove `stream_chat_flutter_core` relative import

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-03-02 16:27:58 +01:00
committed by GitHub
parent a14e54591d
commit c5a9a42c45
2 changed files with 20 additions and 6 deletions
@@ -135,6 +135,7 @@ class MessageListView extends StatefulWidget {
this.systemMessageBuilder,
this.messageListBuilder,
this.errorWidgetBuilder,
this.messageFilter,
this.customAttachmentBuilders,
this.onMessageTap,
this.onSystemMessageTap,
@@ -214,6 +215,9 @@ class MessageListView extends StatefulWidget {
/// of a connection failure.
final ErrorBuilder errorWidgetBuilder;
/// Predicate used to filter messages
final bool Function(Message) messageFilter;
/// Attachment builders for the default message widget
/// Please change this in the [MessageWidget] if you are using a custom implementation
final Map<String, AttachmentBuilder> customAttachmentBuilders;
@@ -281,6 +285,7 @@ class _MessageListViewState extends State<MessageListView> {
@override
Widget build(BuildContext context) {
return MessageListCore(
messageFilter: widget.messageFilter,
loadingBuilder: widget.loadingBuilder ??
(context) {
return Center(