Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fayeed/dash_chat
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.1
Choose a base ref
...
head repository: fayeed/dash_chat
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 2,385 additions and 932 deletions.
  1. +5 −3 .github/ISSUE_TEMPLATE/bug_report.md
  2. +4 −2 .github/ISSUE_TEMPLATE/feature_request.md
  3. +12 −0 .github/ISSUE_TEMPLATE/question.md
  4. +16 −0 .github/workflows/greetings.yml
  5. +177 −0 CHANGELOG.md
  6. +44 −1 README.md
  7. +5 −0 example/.gitignore
  8. +5 −1 example/android/app/build.gradle
  9. +1 −1 example/android/app/src/debug/AndroidManifest.xml
  10. +1 −1 example/android/app/src/main/AndroidManifest.xml
  11. +1 −1 example/android/app/src/main/java/com/example/example/MainActivity.java
  12. +1 −1 example/android/app/src/profile/AndroidManifest.xml
  13. +1 −0 example/android/build.gradle
  14. +2 −1 example/android/gradle.properties
  15. +1 −0 example/ios/Flutter/Debug.xcconfig
  16. +1 −0 example/ios/Flutter/Release.xcconfig
  17. +38 −0 example/ios/Podfile
  18. +396 −0 example/ios/Podfile.lock
  19. +79 −23 example/ios/Runner.xcodeproj/project.pbxproj
  20. +1 −1 example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  21. +3 −0 example/ios/Runner.xcworkspace/contents.xcworkspacedata
  22. +8 −0 example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  23. +138 −175 example/lib/main.dart
  24. +175 −36 example/pubspec.lock
  25. +6 −2 example/pubspec.yaml
  26. +4 −2 lib/dash_chat.dart
  27. +101 −58 lib/src/chat_input_toolbar.dart
  28. +361 −226 lib/src/chat_view.dart
  29. +249 −175 lib/src/message_listview.dart
  30. +61 −23 lib/src/models/chat_message.dart
  31. +55 −7 lib/src/models/chat_user.dart
  32. +25 −2 lib/src/models/quick_replies.dart
  33. +21 −5 lib/src/models/reply.dart
  34. +60 −0 lib/src/models/scroll_to_bottom_style.dart
  35. +35 −25 lib/src/widgets/avatar_container.dart
  36. +41 −0 lib/src/widgets/date_builder.dart
  37. +6 −10 lib/src/widgets/load_earlier.dart
  38. +123 −59 lib/src/widgets/message_container.dart
  39. +33 −30 lib/src/widgets/quick_reply.dart
  40. +21 −14 lib/src/widgets/scroll_to_bottom.dart
  41. +40 −40 pubspec.lock
  42. +6 −7 pubspec.yaml
  43. +22 −0 test/chat_user_test.dart
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
about: Create a report to help us improve this project
title: "[Bug] Your title"
labels: bug
assignees: ''

---

⚠️ V1 is not maintained anymore, check the V2 on: https://github.com/molteo-engineering-team/Dash-Chat-2 ⚠️

**Describe the bug**
A clear and concise description of what the bug is.

6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
title: "[Feature request] Your title"
labels: enhancement
assignees: ''

---

⚠️ V1 is not maintained anymore, check the V2 on: https://github.com/molteo-engineering-team/Dash-Chat-2 ⚠️

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question
about: Ask a question about this project
title: "[Question] Your question ?"
labels: question
assignees: ''

---

⚠️ V1 is not maintained anymore, check the V2 on: https://github.com/molteo-engineering-team/Dash-Chat-2 ⚠️


16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hey, this package is discontinued, Please check https://github.com/SebastienBtr/Dash-Chat-2 instead"
pr-message: "Hey, this package is discontinued, please check https://github.com/SebastienBtr/Dash-Chat-2 instead"
177 changes: 177 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,180 @@
## [1.1.16]
- Pubspec updated to work with new UUID package [#172] https://github.com/fayeed/dash_chat/pull/172 by [@GonzaloAldana](https://github.com/GonzaloAldana)

## [1.1.15-nullsafety]

- Support for sound null-safety added [#164](https://github.com/fayeed/dash_chat/pull/164) by [@diegogarciar](https://github.com/diegogarciar)

## [1.1.15]

- Memory leaked issue fixed, PR [#133](https://github.com/fayeed/dash_chat/pull/133) by [@peter-sg](https://github.com/peter-sg) & [@pycstitch](https://github.com/pycstitch)

## [1.1.14]

- `messageDecorationBuilder` property added.

## [1.1.13]

- Fixed a bug from previous update.

## [1.1.12]

- `inputDisabled` property added.

## [1.1.11]

- Fixed a bug with previous version causing the widget to break.

## [1.1.10]

- Add quick reply horizontal scroll and padding options

## [1.1.9]

- Fixed issue #91, where setting the name was not handled properly

## [1.1.8]

- Fixed issue #78, scrollToBottom widget not scrolling to maxExtent properly

## [1.1.7]

- Fixed issue #30 where scrollToBottom widget was visible when the widget was dismounted.

## [1.1.6]

- Added `firstName` & `lastName` property to User.
- Added `avatarMaxSize` property to avatar Container.
- Fix an issue with text Alignment when buttons are set in message container.

## [1.1.5]

- Added a new property `shouldStartMessagesFromTop` to Dashchat.

## [1.1.4]

- Fixed an issue with date builder and inverted list.
- Replaced SizedBox with Opacity for User Avatar.
- Custom Message padding property added.
- Fixed an issue with avatar position when the list is inverted.
- Added a new property `customProperties` to ChatUser model.

## [1.1.3]

- A small bug fixed with inverted message list.

## [1.1.2]

- Correct alignmnet to message buttons.
- Added readonly mode to dashchat which hides the inputbar.
- Fix avatar exception when username is null.

## [1.1.1]

- Fixed an issue where an conversion `toJson` for class `ChatUser` was crashing the app.

## [1.1.0]

- Ability to send message on Enter or input action keyboard.
- `MediaQuery` replaced with `LayoutBuilder`.
- Added optional paramter for `ChatMessage`
- Ability to have action buttons in ChatMessages.
- Change Avatar `Boxfit.contain` to `Boxfit.cover`.

## [1.0.20]

- `customProperties` property added to ChatMessgae class.
- Color serialization error fixed.

## [1.0.19]

- Fixed issue #51
- fix scroll to top when inverted and send

## [1.0.18]

- `inputTextDirection` property added.

## [1.0.17]

- Ability to set custom focus node for input.

- Removed SingleChildScrollView from root.

- Added `WidgetsBinding.instance.addPostFrameCallback` to prevent scrolling before the messages are built.

## [1.0.16]

- removed unnecessary print from the `message_listview`

- changed 'vedio' field to 'video'

- nullpointer on parsing quick replies; more detailed error reporting for ChatMessage parsing

## [1.0.15]

- If `inverted` is true, it will no longer scroll.

## [1.0.14]

- `textController` property added.

## [1.0.13]

- `textCapitalization` property null error.

## [1.0.12]

- `textCapitalization` property added for Input Toolbar.

## [1.0.11]

- Fixed an issue where `dateFormat` property was not working.
- Fixed an issue where input value was not cleared.
- Fixed an issue where the whole screen incluing the input was scrollable.
- Few improvemnets to Bottom Scroll Button.

## [1.0.10]

- Updated dependency intl to `0.16.0`.

## [1.0.9]

- ScrollController not attached issue fixed.

## [1.0.8]

- Made the default avatar responsive for the current user.

## [1.0.7]

- Made the default avatar responsive.
- Two new property `inputToolbarPadding` & `inputToolbarMargin` added.

## [1.0.6]

- Change the default message container size to fix the overflowing of text.
- Added a new feature to close the keyboard if tap anywhere else on the screen.

## [1.0.5]

- Fixed an issue where `scrollToBottom` widget was not disabled.
- Fixed an issue where message container was not resized properly based on screen width.
- Fixed a performance issue when scroll down.
- Fixed an issue where `onLoadEarlier` was being called every time the listview moved.

## [1.0.4]

- Models updated

## [1.0.3]

- Small fixes to the InputToolbar and ChatMessage class

## [1.0.2]

- ChatMessage serialization added

## [1.0.1]

- Description updated and small fix
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<h1 align="center" style="font-size: 48px;">⚠️ V1 is not maintained anymore, check the V2 on: https://github.com/molteo-engineering-team/Dash-Chat-2 ⚠️</h1>
</p>
<hr>
<p align="center">
<img src="https://media.giphy.com/media/ghBkB5BHQgdhamZ2WA/giphy.gif" />
<h1 align="center" style="font-size: 48px;">💬 Dash Chat</h1>
@@ -24,7 +28,9 @@ To use this package, add `dash_chat` as a [dependency in your pubspec.yaml file]
- Composer actions (to attach photos, etc.) - WIP

### Message object 📦

> example, Chat Message
```dart
ChatMessage(
text: "Hello",
@@ -37,7 +43,9 @@ ChatMessage(
image: "http://www.sclance.com/images/picture/Picture_753248.jpg",
);
```

> example, Chat Message with Quick Replies
```dart
ChatMessage(
text: "This is a quick reply example.",
@@ -69,6 +77,7 @@ ChatMessage(
- `inputDecoration` (InputDecoration) - Used to provide input decoration to the text.
- `messageIdGenerator` (String Function) - Usually new message added by the user gets UUID v4 String generater by [uuid](https://pub.dev/packages/uuid).
- `user` (ChatUser) - The current user object.

```dart
DashChat(
user: ChatUser(
@@ -78,8 +87,10 @@ ChatMessage(
)
);
```

- `onSend` (Function(ChatMessage)) - Callback when sending a message.
- `alwaysShowSend` (bool) - Should the send button be always active defaults to false.
- `avatarMaxSize` (double) - Sets the default Avatar's max size, default is `30.0`.
- `dateFormat` (DateFormat) - Format to use for rendering date default is `yyyy-MM-dd`.
- `timeFormat` (DateFormat) - Format to use for rendering time default is `HH:mm:ss`.
- `showUserAvatar` (bool) - Should the user avatar be shown.
@@ -99,6 +110,7 @@ ChatMessage(
- `inputFooterBuilder` (Widget Function) - A Widget that will be shown below the ChatInputToolbar.
- `maxInputLength` (int) - Main input length of the input text box defaulst to no limit.
- `parsePatterns` (List<MatchText>) - Used to parse text to make a linkified text uses [flutter_parsed_text](https://pub.dev/packages/flutter_parsed_text).

```dart
DashChat(
parsePatterns: <MatchText>[
@@ -117,9 +129,11 @@ ChatMessage(
]
);
```

- `messageContainerDecoration` (BoxDecoration) - Provides a custom style to the message container.
- `leading` (List<Widget\>) - List of Widget to show before the TextField.
- `trailing` (List<Widget\>) - List of Widget to show after the TextField will remove the send button.
- `readOnly` (bool) - Hides the input bar, defaults to `false`.
- `showTraillingBeforeSend` - Should the trailling widgets be shown before the send button defaults to `true`.
- `inputTextStyle` (TextStyle) - Style for the TextField.
- `inputContainerStyle` (BoxDecoration) - TextField container style.
@@ -129,29 +143,58 @@ ChatMessage(
- `inputCursorColor` (Color) - Color of the input cursor defaults to theme.
- `scrollController` (ScrollController) - ScrollController for the MessageListView.
- `messageContainerPadding` (EdgeInsetsGeometry) - Padding for the MessageListView.
- `messagePadding` (EdgeInsets) - Padding for the MessageContainer.
- `onQuickReply` (Funtion(Reply)) - Callback method when the quickReply was tapped on.
- `quickReplyStyle` (BoxDecoration) - Container style for the QuickReply Container.
- `quickReplyTextStyle` (TextStyle) - QuickReply text style.
- `quickReplyBuilder` (Widget Function(Reply)) - Will override the the default QuickReply Widget.
- `scrollToBottom` (bool) - Should the scroll to bottom widget be shown defaults to `true`.
- `scrollToBottomStyle` (ScrollToBottomStyle) - sets the style & position for the scrollToBottom widget.
- `scrollToBottomWidget` (Widget Function()) - Overrides the default scrollToBottomWidget with a custom widget.
- `onScrollToBottomPress` (Function) - override the default behaviour of the onScrollToBottom Widget.
- `shouldShowLoadEarlier` (bool) - Should the LoadEarlier Floating widget be shown or use load as you scroll scheme whcih will call the onLoadEarlier defaults to false which is this scheme.
- `showLoadEarlierWidget` (Widget Function()) - Override the default behaviour of the onScrollToBottom Widget.
- `onLoadEarlier` (Function) - Override the default behaviour of the onLoadEarleir Widget or used as a callback when the listView reaches the top.
- `inputToolbarPadding` (EdgeInsets) - Can be used to add padding to the input toolbar.
- `inputToolbarMargin` (EdgeInsets) - Can be used to add margin to the input toolbar.
- `shouldStartMessagesFromTop` (bool) - Can be used to align messages so that it starts from top to bottom instead of the default bottom to top.
- `textBeforeImage` (bool) - Can be used to set the order of the text and the image inside a message defaults to `true`.
- `quickReplyScroll` (bool) - Should the quick reply options be horizontally scrollable
- `quickReplyPadding` (EdgeInsetsGeometry) - Padding for QuickReply
- `inputDisabled` (bool) - Should the input TextField be disabled, defaults to `false`
- `messageDecorationBuilder` (BoxDecoration Function(ChatMessage, isUser) - Override the message container decoration. [Note: This will override the messageContainerDecoration ]

```dart
DashChat(
...
messageDecorationBuilder: (ChatMessage msg, bool isUser){
return BoxDecoration(
...
color: isUser ? Colors.red : Colors.blue, // example
...
);
},
...
);
```

## Credits 👨🏻‍💻

## Credits 👨🏻‍💻
- Transparent Image - [Brian Egan](https://github.com/brianegan)
- uuid - [Yulian Kuncheff](https://github.com/Daegalus)

## Found this project useful? ❤️

If you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.

## License ⚖️

- [MIT](https://github.com/fayeed/dash_chat/blob/master/LICENSE)

## API details 📝

See the [dash_chat.dart](https://github.com/fayeed/dash_chat/blob/master/lib/dash_chat.dart) for more API details

## Issues and feedback 💭

If you have any suggestion for including a feature or if something doesn't work, feel free to open a Github [issue](https://github.com/fayeed/dash_chat/issues) for us to have a discussion on it.
5 changes: 5 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
@@ -58,6 +59,8 @@
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/flutter_export_environment.sh
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
@@ -70,3 +73,5 @@
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

google-services.json
Loading