From 3c4881daed70a974db83eea67960f4ead0e13201 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Tue, 29 Jun 2021 18:20:06 +0530 Subject: [PATCH] feat: Added new docs --- .../stream_chat_flutter/channel_list_view.mdx | 31 +++++++++++++ .../stream_chat_flutter/introduction.mdx | 3 +- .../stream_chat_flutter/message_input.mdx | 44 +++++++++++++++++++ .../stream_chat_flutter/message_list_view.mdx | 6 ++- 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx index d1c7ec9e..a88c617d 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter/channel_list_view.mdx @@ -4,3 +4,34 @@ sidebar_position: 4 title: ChannelListView --- +![screenshot](https://raw.githubusercontent.com/GetStream/stream-chat-flutter/master/screenshots/channel_list_view.png) +![screenshot](https://raw.githubusercontent.com/GetStream/stream-chat-flutter/master/screenshots/channel_list_view_paint.png) + +It shows the list of current channels. + +```dart +class ChannelListPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + body: ChannelListView( + filter: Filter.in_('members', [StreamChat.of(context).user.id]), + sort: [SortOption('last_message_at')], + pagination: PaginationParams( + limit: 20, + ), + channelWidget: ChannelPage(), + ), + ); + } +} +``` + + +Make sure to have a [StreamChat] ancestor in order to provide the +information about the channels. +The widget uses a [ListView.custom] to render the list of channels. + +The widget components render the ui based on the first ancestor of +type [StreamChatTheme]. +Modify it to change the widget appearance. \ No newline at end of file diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/introduction.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/introduction.mdx index fc8f385e..d143e9fd 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter/introduction.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter/introduction.mdx @@ -2,4 +2,5 @@ id: introduction sidebar_position: 1 title: Introduction ---- \ No newline at end of file +--- + diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/message_input.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/message_input.mdx index 575a2ee5..16719619 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter/message_input.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter/message_input.mdx @@ -4,3 +4,47 @@ sidebar_position: 6 title: Message Input --- +The `MessageInput` widget deals with common elements related to sending a message such as a text field for typing text, +adding media to a message, quoting a message and more. The message input uses a stream channel ancestor to send a message. +The message input can be used along with a message list view to display messages. + +The message input also has commands such as Giphy and more which can be added. It can also be used to add custom attachments to your messages. +The message input is customisable and the orientation of the icons the text field and the send button can be changed. + +Widget used to enter the message and add attachments + +```dart +class ChannelPage extends StatelessWidget { + const ChannelPage({ + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: ChannelHeader(), + body: Column( + children: [ + Expanded( + child: MessageListView( + threadBuilder: (_, parentMessage) { + return ThreadPage( + parent: parentMessage, + ); + }, + ), + ), + MessageInput(), + ], + ), + ); + } +} +``` + +You usually put this widget in the same page of a [MessageListView] +as the bottom widget. + +The widget renders the ui based on the first ancestor of +type [StreamChatTheme]. +Modify it to change the widget appearance. \ No newline at end of file diff --git a/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx b/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx index 36cf7e39..c3a3efc2 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter/message_list_view.mdx @@ -4,7 +4,11 @@ sidebar_position: 5 title: MessageListView --- -The MessageListView shows the list of messages of the current channel. +The `MessageListView` 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: ```dart class ChannelPage extends StatelessWidget {