Skip to content

Commit 2626bb4

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

8 files changed

+639
-799
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: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
# Contributors
2+
#
13
## Main Contributors
24

35
| ![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) |
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).

doc/installation.md

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,59 @@
1-
1. Add dependencies to `pubspec.yaml`
1+
# Installation Guide
2+
#
3+
## Adding the dependency
24

3-
Get the latest version in the 'Installing' tab
4-
on [pub.dev](https://pub.dev/packages/chatview/install)
5+
1. Add the package dependency to your `pubspec.yaml` file:
56

6-
```yaml
7-
dependencies:
8-
chatview: <latest-version>
9-
```
10-
11-
2. Run pub get.
12-
13-
```shell
14-
flutter pub get
15-
```
7+
```yaml
8+
dependencies:
9+
chatview: <latest-version>
10+
```
1611
17-
3. Import package.
12+
You can find the latest version on [pub.dev](https://pub.dev/packages/chatview) under the 'Installing' tab.
1813
19-
```dart
20-
import 'package:chatview/chatview.dart';
21-
```
14+
2. Import the package in your Dart code:
2215
23-
## Messages types compability
16+
```dart
17+
import 'package:chatview/chatview.dart';
18+
```
2419

25-
|Message Types | Android | iOS | MacOS | Web | Linux | Windows |
26-
| :-----: | :-----: | :-: | :---: | :-: | :---: | :-----: |
27-
|Text messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
28-
|Image messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
29-
|Voice messages | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ |
30-
|Custom messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
20+
## Platform-specific configurations
3121

32-
## Platform specific configuration
22+
### For Image Picker
3323

34-
### For image Picker
3524
#### iOS
36-
* Add the following keys to your _Info.plist_ file, located in `<project root>/ios/Runner/Info.plist`:
25+
Add the following keys to your _Info.plist_ file, located in `<project root>/ios/Runner/Info.plist`:
3726

38-
```
39-
<key>NSCameraUsageDescription</key>
40-
<string>Used to demonstrate image picker plugin</string>
41-
<key>NSMicrophoneUsageDescription</key>
42-
<string>Used to capture audio for image picker plugin</string>
43-
<key>NSPhotoLibraryUsageDescription</key>
44-
<string>Used to demonstrate image picker plugin</string>
27+
```xml
28+
<key>NSCameraUsageDescription</key>
29+
<string>Used to demonstrate image picker plugin</string>
30+
<key>NSMicrophoneUsageDescription</key>
31+
<string>Used to capture audio for image picker plugin</string>
32+
<key>NSPhotoLibraryUsageDescription</key>
33+
<string>Used to demonstrate image picker plugin</string>
4534
```
4635

47-
### For voice messages
36+
### For Voice Messages
37+
4838
#### iOS
49-
* Add this two rows in `ios/Runner/Info.plist`
50-
```
51-
<key>NSMicrophoneUsageDescription</key>
52-
<string>This app requires Mic permission.</string>
39+
* Add this row in `ios/Runner/Info.plist`:
40+
```xml
41+
<key>NSMicrophoneUsageDescription</key>
42+
<string>This app requires Mic permission.</string>
5343
```
54-
* This plugin requires ios 10.0 or higher. So add this line in `Podfile`
44+
45+
* This plugin requires iOS 10.0 or higher. Add this line in `Podfile`:
5546
```
56-
platform :ios, '10.0'
47+
platform :ios, '10.0'
5748
```
5849

5950
#### Android
60-
* Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
61-
```
62-
minSdkVersion 21
51+
* Change the minimum Android SDK version to 21 (or higher) in your `android/app/build.gradle` file:
52+
```gradle
53+
minSdkVersion 21
6354
```
6455

65-
* Add RECORD_AUDIO permission in `AndroidManifest.xml`
56+
* Add RECORD_AUDIO permission in `AndroidManifest.xml`:
57+
```xml
58+
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
6659
```
67-
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
68-
```

doc/license.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# License
2+
#
3+
```text
4+
MIT License
5+
Copyright (c) 2022 Simform Solutions
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
```

0 commit comments

Comments
 (0)