From 8afc669826796698b8d4528d697a0fc2d2c930df Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 28 Apr 2022 12:30:59 +0200 Subject: [PATCH 1/2] StreamChannelListView --- .../{channel_list_view.mdx => stream_channel_list_view.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docusaurus/docs/Flutter/stream_chat_flutter/{channel_list_view.mdx => stream_channel_list_view.mdx} (100%) diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/stream_channel_list_view.mdx similarity index 100% rename from docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx rename to docusaurus/docs/Flutter/stream_chat_flutter/stream_channel_list_view.mdx From e0f31778995b969062c60ce29bce1d28188f7547 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 28 Apr 2022 12:31:12 +0200 Subject: [PATCH 2/2] StreamMessageListView --- ..._view.mdx => stream_message_list_view.mdx} | 53 ++++++------------- 1 file changed, 15 insertions(+), 38 deletions(-) rename docusaurus/docs/Flutter/stream_chat_flutter/{message_list_view.mdx => stream_message_list_view.mdx} (55%) diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/stream_message_list_view.mdx similarity index 55% rename from docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx rename to docusaurus/docs/Flutter/stream_chat_flutter/stream_message_list_view.mdx index 0ac78f7d..19a041a0 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter/stream_message_list_view.mdx @@ -1,30 +1,30 @@ --- -id: message_list_view +id: stream_message_list_view sidebar_position: 5 -title: MessageListView +title: StreamMessageListView --- A Widget For Displaying A List Of Messages -Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/MessageListView-class.html) +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamMessageListView-class.html) ![](../assets/message_list_view.png) ### Background -Every channel can contain a list of messages sent by users inside it. The `MessageListView` widget +Every channel can contain a list of messages sent by users inside it. The `StreamMessageListView` widget displays the list of messages inside a particular channel along with possible attachments and -other message attributes (if the message is pinned for example). This sets it apart from the `MessageSearchListView` +other message attributes (if the message is pinned for example). This sets it apart from the `StreamMessageSearchListView` which may not contain messages only from a single channel and is used to search for messages across many. ### Basic Example -The `MessageListView` shows the list of messages of the current channel. It has inbuilt support for +The `StreamMessageListView` shows the list of messages of the current channel. It has inbuilt support for common messaging functionality: displaying and editing messages, adding / modifying reactions, support for quoting messages, pinning messages, and more. -An example of how you can use the MessageListView is: +An example of how you can use the `StreamMessageListView` is: ```dart class ChannelPage extends StatelessWidget { @@ -35,19 +35,13 @@ class ChannelPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: ChannelHeader(), + appBar: StreamChannelHeader(), body: Column( children: [ Expanded( - child: MessageListView( - threadBuilder: (_, parentMessage) { - return ThreadPage( - parent: parentMessage, - ); - }, - ), + child: StreamMessageListView(), ), - MessageInput(), + StreamMessageInput(), ], ), ); @@ -61,7 +55,7 @@ Threads are made of a parent message and replies linked to it. To enable threadi to supply a `threadBuilder` which will supply the page when the thread is clicked. ```dart -MessageListView( +StreamMessageListView( threadBuilder: (_, parentMessage) { return ThreadPage( parent: parentMessage, @@ -72,10 +66,10 @@ MessageListView( ![](../assets/message_list_view_threads.png) -The `MessageListView` itself can render the thread by supplying the `parentMessage` parameter. +The `StreamMessageListView` itself can render the thread by supplying the `parentMessage` parameter. ```dart -MessageListView( +StreamMessageListView( parentMessage: parent, ), ``` @@ -85,31 +79,14 @@ MessageListView( You can also supply your own implementation for displaying messages using the `messageBuilder` parameter. :::note -To customize the existing implementation, look at the `MessageWidget` documentation instead. +To customize the existing implementation, look at the `StreamMessageWidget` documentation instead. ::: ```dart -MessageListView( +StreamMessageListView( messageBuilder: (context, details, messageList, defaultImpl) { // Your implementation of the message here // E.g: return Text(details.message.text ?? ''); }, ), ``` - -### Enabling Message Pinning - -Message pins save and highlight the message in the `MessageListView`. To enable users to pin the message, -make sure the pin permissions are granted for different types of users on the dashboard. After confirming -the appropriate users have permissions, add the user types in the `pinPermissions` parameter. - -```dart -MessageListView( - //... - pinPermissions: ['admin', 'userType1', 'userType2'], -), -``` - -This will allow these user types to pin messages through the message actions modal. - -![](../assets/message_list_view_pin.png)