GithubHelp home page GithubHelp logo

sebastienbtr / dash-chat-2 Goto Github PK

View Code? Open in Web Editor NEW
173.0 8.0 87.0 400 KB

The most complete Chat UI for flutter. Easy to use, highly customizable and fully featured

Home Page: https://pub.dev/packages/dash_chat_2

License: MIT License

Dart 94.98% Kotlin 0.11% Ruby 1.21% Swift 0.36% Objective-C 0.03% HTML 3.30%
flutter chat chat-application chat-room dart android ios ui uikit ui-kit

dash-chat-2's Introduction

dash-chat-2's People

Contributors

alamin-karno avatar allcontributors[bot] avatar chuusungmin avatar derekpitts28 avatar farmery avatar fufesou avatar funjay avatar kaedeee avatar legendaf avatar sebastienbtr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dash-chat-2's Issues

[Bug] Open URI's from the chat message

Describe the bug

When a message contains an uri, i get a ERR_UNKNOWN_URL_SCHEME

To Reproduce

Send a message containing a link and open it up!

Expected behavior

Open a dynamic link and redirect to another screen

Screenshots

Screen.Recording.2022-09-26.at.21.37.10.mov

Environment

  • OS: iOS, Android

[Feature request] Expose default media widgets

Is your feature request related to a problem? Please describe.
I am trying to add a custom audio media widget using media builder. Just for adding one component, I have to create new image and video components.

Describe the solution you'd like
Expose default media widgets.

Update Message status

A feature

I will make a PR if needed

Can we have other status like
none
read
pending
sent
received
failed

Having well defined Message status can reduce logics when implementing status in your code.

thanks

How to select text/copy messages to clipboard?

Hello, I am having issues copying the text from messages to the clipboard. What is the best practice for this?

I have tried wrapping my DashChat inside a SelectableArea() and also using Clipboard.setData() with no luck. Any advice would be appreciated!

Cache Network image plugin throws compile time errors

After integrating dash chat 2 and firebase I am facing this error message on my terminal
when do flutter run. Which was not available previously.
I noticed that cached_network_image-3.2.0 is only from dash_chat_2

../../sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-3.2.0/
lib/src/image_provider/multi_image_stream_completer.dart:152:22: Warning:
Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes
null.

  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart'
    ('../../sdk/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance?.scheduleFrameCallback(_handleAppFrame);
    ^
    ../../sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-3.2.0/
    lib/src/image_provider/cached_network_image_provider.dart:109:29: Warning:
    Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes
    null.
  • 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart'
    ('../../sdk/flutter/packages/flutter/lib/src/painting/binding.dart').
    () => PaintingBinding.instance?.imageCache?.evict(key),

can you provide any assistance to resolve this
Environment

  • OS: [IOS, ANdroid]
  • Device: [ iPhone13 (IOS 15.5), Pixel 4a (Android 13)] | Emulator
  • Flutter: [2.10.4]
  • Xcode [latest]

Video messages bug

Continue #27

Seems to me, that after adding a key, and you have more than 2 videos in a row, it always rebuilds videos when scrolling;
Can it be somehow fixed? I was trying to solve this by adding AutomaticKeepAliveClientMixin but got zero results;
And if I remove the unique key, I get previous bug with the old video thumbnail.

Attaching recording where I added 1 more video to the example data.

Screen.Recording.2023-08-31.at.01.17.30.mov

Sent messages are same as receives ones in ui

Hi, thank you for great package. But I have a problem

image

I have this code. But in ui sent and received messages are in same alignmet. They have different id, different image. But it's not looking like as I sent message

photo_2023-07-27 15 27 24

Why my messages are not going to right?
On the image above, "N O T" is me

[Feature request/Bug] No way to control padding added when Avatar is disabled

Is your feature request related to a problem? Please describe.

When showCurrentUserAvatar is false in MessageOptions you have no way to control the padding that gets added (10). Our way around was to return a SizedBox.shrink() in the avatarBuilder. However, it looks like if showCurrentUserAvatar is set to true it will add a phantom avatar with the same user.id (not the other person id in the convo). This means that in our avatarBuilder we are not able to hide this avatar which exists in the stack but it set to a opacity of 0.

Describe the solution you'd like

A way to control the padding or not add a phantom avatar. Example 3 gets us close to being able to do what we want. But there is a nagging overflow issue because the phantom avatar exists in the stack.

Example 1 - in avatar builder returning SizedBox.shrink() for current user + showCurrentUserAvatar: false
https://user-images.githubusercontent.com/825344/236341244-c0d4eb57-1f4a-45c4-a1ed-0c7ce86cb02b.png

Example 2 - in avatar builder returning avatar for both + showCurrentUserAvatar: true
https://user-images.githubusercontent.com/825344/236341213-cc8870a1-ad4a-4638-a769-aaf3aad89e12.png

Example 3 - in avatar builder returning SizedBox.shrink() for current user + showCurrentUserAvatar: true
https://user-images.githubusercontent.com/825344/236341684-4b86eea8-d234-499f-843e-2f3c52d777b5.png

[Bug] Doesn't respond to observable value changes

The DashChat widget doesn't reflect changes to observable values in a GetXController. In my instance, I'm using a settings controller to set MessageOptions.currentUserContainerColor and MessageOptions.currentUserTextColor. When I toggle between light and dark mode, other elements wrapped by an Obx(() => on the same page respond to this value change, but the DashChat doesn't.

   body: Obx(
          () => DashChat(
            messageOptions: MessageOptions(
                showCurrentUserAvatar: true,
                currentUserContainerColor:
                    _settingsController.currentListTheme.value.offsetColor,
                currentUserTextColor:
                    _settingsController.currentListTheme.value.textColor),
            currentUser: user,
            onSend: (ChatMessage m) {
              setState(() {
                messages.insert(0, m);
              });
            },
            messages: messages,
          ),
        ), 

Steps to reproduce the behavior:

  1. Put DashChat on a widget page within a scaffold,
  2. Create a GetxController, and observable values for colors and apply them to DashChat,
  3. Make the controller's color values respond to light/dark mode changes,
  4. Toggle between light and dark mode,
  5. Notice that the colors do not change.

Expected behavior

It is expected that DashChat will respond to observable value changes.

Environment

  • OS: macOS 12.4
  • Device: iOS Simulator
  • Language Version: Channel stable, 3.0.4
  • Software/library Version: DashChat ^0.0.10

Additional context

Great product, just need this.

Update for intl 0.18

Because dash_chat_2 0.0.15 depends on intl ^0.17.0 and no versions of dash_chat_2 match >0.0.15 <0.1.0, dash_chat_2 ^0.0.15 requires intl ^0.17.0.
So, because papplic depends on both intl ^0.18.0 and dash_chat_2 ^0.0.15, version solving failed.

[Bug] Mention bug

If i double mention a user for example:
Hello @Niki @Niki, you should check #channel
It will cause Bad state no element on default_message_text line 70

Can we reconsider the name Dash-chat-2?

Can we reconsider the name Dash-chat-2?
Like chat-ui dash-chat-ui dash-ui im-ui or something better?

Dash-Chat-2 这个名称能否再斟酌一下呢?
比如: chat-ui dash-chat-ui dash-ui im-ui 或者其他的更好的名称?

Fontsize Up

Hello, I wanted to reach out to see if I could maybe get some help on an issue regarding changing the style of the text in the messages dash chat2 generates. In our project we are using dash chat2 to help connect senior citizens with other users of the app; to make it more accessible we wanted to be able to increase the font size for all text fields on the chat widget. I'm having trouble figuring out how to implement those properties. Would you maybe be willing to provide a quick example or some pointers on how to do so?

[Bug] Rouge padding on bottom of MessageList / ListView.builder

Describe the bug

There is a rogue padding at the bottom of the ListViewBuilder. It looks to be added from the SilverPadding.

See: https://api.flutter.dev/flutter/widgets/ListView-class.html

"By default, ListView will automatically pad the list's scrollable extremities to avoid partial obstructions indicated by MediaQuery's padding. To avoid this behavior, override with a zero padding property."

This also leads to un wanted jumping when coming in and out of the input as there is no padding added when focused in the input.

To Reproduce

Steps to reproduce the behavior:

  1. Spin the example app up
  2. Go to basic example
  3. Observe extra padding at the bottom of the list

Expected behavior

No extra padding to be on the bottom of the list.

RPReplay_Final1675419428.MP4

Screenshots

Broken:

RPReplay_Final1675419451.MP4

Environment

  • OS: Mac
  • Device: iPhone 14 Pro
  • Flutter Version: 3.7
  • Software/library Version: latest

Additional context

I opened a PR to fix this: #38

[feature request] Ability to add custom separators other than date separators

Description:

Currently there is only date separators in the message_list_options, though there are other separators like banner for {count} Unread Messages. For implementing this, there's nothing exposed in the options class.

There's support for custom message onclick callback functions. It would be great to add a onTapDown to the gesture detector as well, so that the offset for the user touch can be captured and used. This can be considered another feature request.

Finally, the message + timestamp in the message_container can be implemented with a stack instead of a column.

These changes are present in the following PRs
3.10 - #59
3.7 - #58

Message status

Do you continue to develop the package? To assist, I can open a pull request (for message status).

Inverting the chat

Hi, i searched all through the documentation.

Can someone help me with inverting the chats? eg

having the last message down and not up ( earlier messages up ) - like whatsapp

thanks

[Bug] DashChat widget without AppBar clips the message list

Describe the bug

When not using an AppBar in the Scaffold the message list view clips at the bottom. Please see video.

To Reproduce

Steps to reproduce the behavior:

  1. Add a scaffold.
  2. Do not add an AppBar to the Scaffold.
  3. Add DashChat widget to scaffold body and add enough messages so you can scroll.
  4. See when you scroll at the bottom of the messages view it clips before reaching the bottom.

Expected behavior
List should reach the top of the input body.

Screenshots

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-03-22.at.13.59.25.mp4

I wrapped the components in a containers and colored them to show the excess space the input box is taking up.

simulator_screenshot_E612EC9C-6EB0-4AD6-B555-4ACCE0A150D6

Environment

  • OS: Mac
  • Device: iOS Emulator
  • Language Version: Flutter 3.7.7
  • Software/library Version 0.0.15

Additional context

Let me know if you need any more information this is a pretty easy one to replicate.

[Bug] sendOnEnter doesn't seem to work

Describe the bug

Thanks for the great lib! I'm trying to use the sendOnEnter functionality, but it seems to have no effect. No matter what I do, the enter key always starts a new line. Looking through the code, I don't see this used at all except in the onSubmitted callback, and I can't seem to figure out where/if it's ever called.

To Reproduce

Steps to reproduce the behavior:

  1. Using the base demo.
  2. Add the sendOnEnter option to InputOptions.
  3. Run the app and hit enter.
  4. You'll see a new line instead of submitting the text as is.

Expected behavior

I expect the text to be sent when hitting the "return" key (and ideally this would be set to "enter" or "send" instead in this mode).

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • OS: Mac
  • Device: iPhone SE Emulator
  • Language Version: 2.17.5
  • Software/library Version 0.0.7

Additional context

Add any other context about the problem here.

[Question] In this new version is possible to show an input action keyboard below the input field?

Dear developers,

Thank you very much for your development. I have a question, is it possible in this new version to add an action keyboard below the input field, as it was possible in the previous version with the option inputFooterBuilder? Now I try with chatFooterBuilder, but the options are over the input field is required that this options appears below the input field.

Thank you for your answer.

[Bug] Android example broken

Describe the bug

One or more plugins requires compileSdkVersion 31

Warning: The plugin path_provider_android requires Android SDK version 31.
For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to /Users/ivan.semkin/Downloads/Dash-Chat-2-main/example/android/app/build.gradle:
android {
  compileSdkVersion 31
  ...
}

To Reproduce

Steps to reproduce the behavior:

  1. Open example project
  2. Try to build it on Android
  3. See error

Expected behavior

Android example builds and launches

Environment

  • OS: macOS 12.4
  • Device: Android
  • Software/library Version 0.0.6 (latest)

[Question] Why might DashChat not resize when `resizeToAvoidBottomInset` is true?

Hello,

This may not be the right place to post, but I don't know where else to ask.

I recently completed a migration from Dash Chat 1 -> Dash Chat 2, and this is what's happening with the chat.

Simulator Screen Shot - iPhone 14 Pro - 2023-06-04 at 21 18 35

The keyboard is hiding the chat input, but with dash chat 1 the chat widget would resize.

Screenshot 2023-06-04 at 9 20 08 PM

This code was previously generated by a tool "FlutterFlow", and I've been tasked with upgrading it to Dart 3 / full null safety. I think DashChat not resizing has something to do with this crazy widget tree?

[Bug] - strange behavior with video messages

As you can see in the attached video, when i'm sending 2 videos one after another it behave's strangely, it doesn't happen with photos and regular text

WhatsApp.Video.2022-09-16.at.13.26.04.mp4

[Bug] Mention User Overlay doesn't dismiss properly and stays on every screen sometimes.

I was checking out the example app provider by the team and when I try mentions feature there is unexpected behaviour from the overlay, it doesn't get closed properly ans stays through every screen.

It works fine when :

  1. If I select any name from the list
  2. If I type @abc then continue typing.

Fails when:

  1. type @absc and press backspace , then overlay don't get dismised and there's this issue as in screenshot.
  2. unexpectedly sometimes when writing mentioning names not in list or even names from the list (see video for ref )

To Reproduce

Steps to reproduce the behavior:

  1. Compile example app.
  2. go to mentions page
  3. type @anyname not in user list and dismiss keyboard without inputting any other character.
    or
    @(any name not in list or even from list and then continue typing) , try multiple times (see the attached video for ref)

Expected behavior
Overlay should get dismissed when keyboard is dismissed and when no user is selected from the list typing is going on.

Screenshots
Screenshot 2022-09-15 at 6 23 56 PM
Screenshot 2022-09-15 at 6 23 34 PM

simulator screens
WhatsApp Image 2022-09-14 at 5 46 50 PM

This happened a lot while testing (sometimes it happens and sometimes not)

WhatsApp.Video.2022-09-15.at.6.35.24.PM.mp4

Environment

  • OS: [e.g. Mac m1 pro 2021]
  • Device: [e.g. moto edge 20 fusion] | Emulator - pixel 4 a API 31
  • Language Version: [e.g 3.3.0]
  • Software/library Version [dash_chat_2 0.0.14]

Additional context

Suggestion - on mention callback should be called when trigger character is typed, so that we can show all user list.

Incompatibility with flutter_localizations because of intl dependency

After Flutter update to 3.10.0 (with Dart 3.0) I can't use dash_chat_2 with flutter_localizations or easy_localisations packages..
Because dash_chat_2 >=0.0.16 depends on intl ^0.18.1 and dash_chat_2 <0.0.16 depends on intl ^0.17.0, every version of dash_chat_2 requires intl ^0.17.0 or ^0.18.1.
And because every version of flutter_localizations from sdk depends on intl 0.18.0, flutter_localizations from sdk is incompatible with dash_chat_2.
So, because eschool_mobile depends on both flutter_localizations from sdk and dash_chat_2 ^0.0.15, version solving failed.

The strange thing is that in pubspec.yaml of dash_chat_2 the "intl: ^0.18.0" is written... Seems like one of the internal dash_chat_2 packages sets additional dependency to intl ^0.18.1

How to mention user with the same name?

i have a
List<Map<String, dynamic>> userList = [{"fullname": "demo", "id": "1"},{"fullname":"demo", "id": "2"}]
when i mention the first demo user it will take the demo user with id = 1 and mention the demo user it will take the demo user with id= 2
i have tried so many ways to format the String when use onMentionClick function but still fail

Multiline input doesn't expand

When creating long input text, it scrolls horizontally, instead of expanding vertically till the number of lines is reached. As I can see in the code the TextField of the input doesn't have any expanded property or min/maxLines property assigned and that might be the problem (it is probably handled in some other way...).

Part of the code:

DashChat(
                  currentUser: _currentUser,
                  inputOptions: InputOptions(
                    inputMaxLines: 5,
                    sendOnEnter: true,
                  onSend: (ChatMessage m) {
                    getChatReponse(m);
                  },
                  messages: _messages,
                ),

Unable to Implement Pagination with Scroll Listener in Dash Chat 2

Hello,

I am currently using the Dash Chat 2 package for Flutter in my project and I am facing some difficulties implementing pagination with a scroll listener for chat.

Here's what I am trying to achieve:

  • I want to load more messages when the user scrolls up to the top of the chat.
  • I am trying to use a scroll listener to detect when the user has scrolled to the top so that I can load more messages.

Could you please provide some guidance on how I can successfully implement this feature? Any help would be greatly appreciated.

Thank you in advance for your time and assistance.

Best regards,
Mujahedul Islam.

[Question] What is improved from dash_chat (v1)?

I am guessing this package is related to https://pub.dev/packages/dash_chat, but i do not know what is the difference between the two. Is this an enhancement of the original package or a completely new package with a lot of the same features?

If this package is suppose to be Dashchat´s v2 update, can you please update the documentation on the dash_chat package to reflect this, with a link to the new package? Also a small text with the reason of the new package name would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.