-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,444 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Main Contributors | ||
|
||
| ![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) | ![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) | | ||
|:------------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:------------------------------------------------------------:|:------------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:|:----------------------------------------------------------:| | ||
| [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) | [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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
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'; | ||
``` | ||
## Messages types compability | ||
|Message Types | Android | iOS | MacOS | Web | Linux | Windows | | ||
| :-----: | :-----: | :-: | :---: | :-: | :---: | :-----: | | ||
|Text messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ||
|Image messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ||
|Voice messages | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ | | ||
|Custom messages | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ||
## Platform specific configuration | ||
### For image Picker | ||
#### iOS | ||
* Add the following keys to your _Info.plist_ file, located in `<project root>/ios/Runner/Info.plist`: | ||
``` | ||
<key>NSCameraUsageDescription</key> | ||
<string>Used to demonstrate image picker plugin</string> | ||
<key>NSMicrophoneUsageDescription</key> | ||
<string>Used to capture audio for image picker plugin</string> | ||
<key>NSPhotoLibraryUsageDescription</key> | ||
<string>Used to demonstrate image picker plugin</string> | ||
``` | ||
### For voice messages | ||
#### iOS | ||
* Add this two rows in `ios/Runner/Info.plist` | ||
``` | ||
<key>NSMicrophoneUsageDescription</key> | ||
<string>This app requires Mic permission.</string> | ||
``` | ||
* This plugin requires ios 10.0 or higher. So add this line in `Podfile` | ||
``` | ||
platform :ios, '10.0' | ||
``` | ||
#### Android | ||
* Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file. | ||
``` | ||
minSdkVersion 21 | ||
``` | ||
* Add RECORD_AUDIO permission in `AndroidManifest.xml` | ||
``` | ||
<uses-permission android:name="android.permission.RECORD_AUDIO"/> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
... | ||
} | ||
``` |
Oops, something went wrong.