Skip to content

Commit 6aa07cf

Browse files
Innovativetech490Sahil-Simform
authored andcommitted
doc: 📝 Updated Documentation
1 parent c61e314 commit 6aa07cf

File tree

9 files changed

+1490
-800
lines changed

9 files changed

+1490
-800
lines changed

doc/advance_usage.md

Lines changed: 196 additions & 565 deletions
Large diffs are not rendered by default.

doc/basic_usage.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
1. Adding a chat controller.
1+
# Basic Usage
2+
#
3+
Here's how to integrate ChatView into your Flutter application with minimal setup:
4+
5+
## Step 1: Create a Chat Controller
6+
7+
The `ChatController` manages the state of your chat view:
8+
29
```dart
310
final chatController = ChatController(
411
initialMessageList: messageList,
@@ -8,44 +15,56 @@ final chatController = ChatController(
815
);
916
```
1017

11-
2. Adding a `ChatView` widget.
18+
## Step 2: Add the ChatView Widget
19+
1220
```dart
1321
ChatView(
1422
chatController: chatController,
1523
onSendTap: onSendTap,
16-
chatViewState: ChatViewState.hasMessages, // Add this state once data is available.
24+
chatViewState: ChatViewState.hasMessages, // Add this state once data is available
1725
)
1826
```
1927

20-
3. Adding a messageList with `Message` class.
28+
## Step 3: Define Message List
29+
30+
Define your initial message list:
31+
2132
```dart
2233
List<Message> messageList = [
2334
Message(
2435
id: '1',
2536
message: "Hi",
26-
createdAt: createdAt,
37+
createdAt: DateTime.now(),
2738
sentBy: userId,
2839
),
2940
Message(
3041
id: '2',
3142
message: "Hello",
32-
createdAt: createdAt,
43+
createdAt: DateTime.now(),
3344
sentBy: userId,
3445
),
3546
];
3647
```
3748

38-
4. Adding a `onSendTap`.
49+
## Step 4: Implement onSendTap Callback
50+
51+
Handle the send message event:
52+
3953
```dart
40-
void onSendTap(String message, ReplyMessage replyMessage, MessageType messageType){
41-
final message = Message(
54+
void onSendTap(String message, ReplyMessage replyMessage, MessageType messageType) {
55+
// Create a new message
56+
final newMessage = Message(
4257
id: '3',
43-
message: "How are you",
58+
message: message,
4459
createdAt: DateTime.now(),
45-
senBy: currentUser.id,
60+
sentBy: currentUser.id,
4661
replyMessage: replyMessage,
4762
messageType: messageType,
4863
);
49-
chatController.addMessage(message);
64+
65+
// Add message to chat controller
66+
chatController.addMessage(newMessage);
5067
}
51-
```
68+
```
69+
70+
> Note: You can evaluate message type from the 'messageType' parameter and perform operations accordingly.

doc/contributor.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
# Contributors
2+
#
13
## Main Contributors
24

3-
| ![img](https://avatars.githubusercontent.com/u/25323183?v=4) | ![img](https://avatars.githubusercontent.com/u/64645989?v=4) | ![img](https://avatars.githubusercontent.com/u/56400956?v=4) | ![img](https://avatars.githubusercontent.com/u/65003381?v=4) | ![img](https://avatars.githubusercontent.com/u/41247722?v=4) |
4-
|:------------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|
5-
| [Vatsal Tanna](https://github.com/vatsaltanna) | [Dhvanit Vaghani](https://github.com/DhvanitVaghani) | [Ujas Majithiya](https://github.com/Ujas-Majithiya)| [Apurva Kanthraviya](https://github.com/apurva780) | [Aditya Chavda](https://github.com/aditya-chavda) |
5+
| ![img](https://avatars.githubusercontent.com/u/25323183?v=4&s=200) | ![img](https://avatars.githubusercontent.com/u/64645989?v=4&s=200) | ![img](https://avatars.githubusercontent.com/u/56400956?v=4&s=200) | ![img](https://avatars.githubusercontent.com/u/65003381?v=4&s=200) | ![img](https://avatars.githubusercontent.com/u/41247722?v=4&s=200) |
6+
|:------------------------------------------------------------------:|:------------------------------------------------------------------:|:------------------------------------------------------------:|:------------------------------------------------------------:|:------------------------------------------------------------:|
7+
| [Vatsal Tanna](https://github.com/vatsaltanna) | [Dhvanit Vaghani](https://github.com/DhvanitVaghani) | [Ujas Majithiya](https://github.com/Ujas-Majithiya) | [Apurva Kanthraviya](https://github.com/apurva780) | [Aditya Chavda](https://github.com/aditya-chavda) |
8+
9+
## How to Contribute
10+
11+
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
12+
13+
1. Fork the repository
14+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
15+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
16+
4. Push to the branch (`git push origin feature/amazing-feature`)
17+
5. Open a Pull Request
18+
19+
## Report Issues
20+
21+
If you find any bugs or have feature requests, please create an issue in the [issue tracker](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues).
22+
23+
## Project Resources
24+
25+
- GitHub Repository: [flutter_chatview](https://github.com/SimformSolutionsPvtLtd/flutter_chatview).
26+
- Package on pub.dev: [chatview](https://pub.dev/packages/chatview).
27+
- Web Demo: [Chat View Example](https://simformsolutionspvtltd.github.io/flutter_chatview/).
28+
- Blog Post: [ChatView: A Cutting-Edge Chat UI Solution](https://medium.com/simform-engineering/chatview-a-cutting-edge-chat-ui-solution-7367b1f9d772).

0 commit comments

Comments
 (0)