Skip to content

Commit

Permalink
doc: separate out readme content
Browse files Browse the repository at this point in the history
  • Loading branch information
apurva010 committed Jul 15, 2024
1 parent 2c70e16 commit 5183e2d
Show file tree
Hide file tree
Showing 8 changed files with 1,006 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/contributors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Main Contributors

<table>
<tr>
<td align="center"><a href="https://github.com/vatsaltanna"><img src="https://avatars.githubusercontent.com/u/25323183?s=100" width="100px;" alt=""/><br /><sub><b>Vatsal Tanna</b></sub></a></td>
<td align="center"><a href="https://github.com/DhvanitVaghani"><img src="https://avatars.githubusercontent.com/u/64645989?v=4" width="100px;" alt=""/><br /><sub><b>Dhvanit Vaghani</b></sub></a></td>
<td align="center"><a href="https://github.com/Ujas-Majithiya"><img src="https://avatars.githubusercontent.com/u/56400956?v=4" width="100px;" alt=""/><br /><sub><b>Ujas Majithiya</b></sub></a></td>
<td align="center"><a href="https://github.com/apurva780"><img src="https://avatars.githubusercontent.com/u/65003381?v=4" width="100px;" alt=""/><br /><sub><b>Apurva Kanthraviya</b></sub></a></td>
<td align="center"><a href="https://github.com/aditya-chavda"><img src="https://avatars.githubusercontent.com/u/41247722?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Chavda</b></sub></a></td>
</tr>
</table>
<br/>
5 changes: 5 additions & 0 deletions doc/how_to_use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## How to use

Check out [blog](https://medium.com/simform-engineering/chatview-a-cutting-edge-chat-ui-solution-7367b1f9d772) for better understanding and basic implementation.

Also, for whole example, check out the **example** app in the [example](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/tree/main/example) directory or the 'Example' tab on pub.dartlang.org for a more complete example.
23 changes: 23 additions & 0 deletions doc/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Installing

1. Add dependencies to `pubspec.yaml`

Get the latest version in the 'Installing' tab
on [pub.dev](https://pub.dev/packages/chatview/install)

```yaml
dependencies:
chatview: <latest-version>
```
2. Run pub get.
```shell
flutter pub get
```

3. Import package.

```dart
import 'package:chatview/chatview.dart';
```
171 changes: 171 additions & 0 deletions doc/migration_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
## Migration guide for release 2.0.0

- Renamed `sendBy` field to `sentBy` in `Message` class.

- Renamed `chatUsers` field to `otherUsers` in `ChatController` class.

- Moved `currentUser` field from `ChatView` widget to `ChatController` class

- Updated `id` value in `copyWith` method of `Message` to have correct value.

- Removed `showTypingIndicator` field from `ChatView` and replaced it with `ChatController.showTypingIndicator`.

Before:
```dart
ChatView(
showTypingIndicator:false,
),
```
After:
```dart
/// use it with your [ChatController] instance.
_chatContoller.setTypingIndicator = true; // for showing indicator
_chatContoller.setTypingIndicator = false; // for hiding indicator
```
- Updated `ChatUser`, `Message` and `ReplyMessage` Data Model's `fromJson` and `toJson` methods:
##### in `ChatUser.fromJson`:
Before:
```dart
ChatUser.fromJson(
{
...
'imageType': ImageType.asset,
...
},
),
```
After:
```dart
ChatUser.fromJson(
{
...
'imageType': 'asset',
...
},
),
```
##### in `ChatUser.toJson`:
Before:
```dart
{
...
imageType: ImageType.asset,
...
}
```
After:
```dart
{
...
imageType: asset,
...
}
```
##### in `Message.fromJson`:
Before:
```dart
Message.fromJson(
{
...
'createdAt': DateTime.now(),
'message_type': MessageType.text,
'voice_message_duration': Duration(seconds: 5),
...
}
)
```
After:
```dart
Message.fromJson(
{
...
'createdAt': '2024-06-13T17:32:19.586412',
'message_type': 'text',
'voice_message_duration': '5000000',
...
}
)
```
##### in `Message.toJson`:
Before:
```dart
{
...
createdAt: 2024-06-13 17:23:19.454789,
message_type: MessageType.text,
voice_message_duration: 0:00:05.000000,
...
}
```
After:
```dart
{
...
createdAt: 2024-06-13T17:32:19.586412,
message_type: text,
voice_message_duration: 5000000,
...
}
```
##### in `ReplyMessage.fromJson`:
Before:
```dart
ReplyMessage.fromJson(
{
...
'message_type': MessageType.text,
'voiceMessageDuration': Duration(seconds: 5),
...
}
)
```
After:
```dart
ReplyMessage.fromJson(
{
...
'message_type': 'text',
'voiceMessageDuration': '5000000',
...
}
)
```
in `ReplyMessage.toJson`:
Before:
```dart
{
...
message_type: MessageType.text,
voiceMessageDuration: 0:00:05.000000,
...
}
```
After:
```dart
{
...
message_type: text,
voiceMessageDuration: 5000000,
...
}
```
Loading

0 comments on commit 5183e2d

Please sign in to comment.