feat: Added new docs
This commit is contained in:
@@ -4,3 +4,34 @@ sidebar_position: 4
|
|||||||
title: ChannelListView
|
title: ChannelListView
|
||||||
---
|
---
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
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.
|
||||||
@@ -3,3 +3,4 @@ id: introduction
|
|||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
title: Introduction
|
title: Introduction
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,47 @@ sidebar_position: 6
|
|||||||
title: Message Input
|
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: <Widget>[
|
||||||
|
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.
|
||||||
@@ -4,7 +4,11 @@ sidebar_position: 5
|
|||||||
title: MessageListView
|
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
|
```dart
|
||||||
class ChannelPage extends StatelessWidget {
|
class ChannelPage extends StatelessWidget {
|
||||||
|
|||||||
Reference in New Issue
Block a user