Coder Social home page Coder Social logo

When message too long about dash_chat HOT 17 CLOSED

fayeed avatar fayeed commented on June 23, 2024
When message too long

from dash_chat.

Comments (17)

fayeed avatar fayeed commented on June 23, 2024

@winsdom123456 Thanks for reporting this issue, I investigated it and it only turns up in small phones I have fixed this and release a patched version 1.0.6 try this and let me know if you face any problem.

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

@winsdom123456 Thanks for reporting this issue, I investigated it and it only turns up in small phones I have fixed this and release a patched version 1.0.6 try this and let me know if you face any problem.

I tried the 1.0.6 version. Still seems to be an issue.

image

from dash_chat.

winsdom123456 avatar winsdom123456 commented on June 23, 2024

@fayeed YES, I have tried the smallest phone, and it is OK now, thanks!

from dash_chat.

winsdom123456 avatar winsdom123456 commented on June 23, 2024

@thevzurd You should make sure you are using the version 1.0.6, I think it will be OK, wait for your result

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

@fayeed @winsdom123456 , no the fix is still not working for me. :(

from dash_chat.

winsdom123456 avatar winsdom123456 commented on June 23, 2024

@fayeed Oh, I found this bug again in debug version. I found it is OK in profile version, but not in debug version in small iPhone, you can have a try.

from dash_chat.

fayeed avatar fayeed commented on June 23, 2024

@winsdom123456 @thevzurd thanks I will take a look at it once more, anyway what devices did you guys saw this issue in?

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

@fayeed I use Moto X, Android version 5.1

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

@fayeed also in my screenshot, why do you this there is space below the text ?

from dash_chat.

fayeed avatar fayeed commented on June 23, 2024

@thevzurd @winsdom123456 The problem was the avatar container was not responsive that is it had a fixed height & width of 40.0 which would create problems is small devices. Anway I have fixed the issue and released a new version 1.0.7.

from dash_chat.

fayeed avatar fayeed commented on June 23, 2024

@thevzurd As for the extra space that is visible in the image below the text I am not able to reproduce it.

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

image

@fayeed still the same issue. I notice that the avatar has shrunken in size.

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

@thevzurd @winsdom123456 The problem was the avatar container was not responsive that is it had a fixed height & width of 40.0 which would create problems is small devices. Anway I have fixed the issue and released a new version 1.0.7.

I think ListTile widget should help you solve this issue, because it is responsive by design. The avatar will come in leading and the chat message + the time stamp will come in the tilte/subtitle.

from dash_chat.

fayeed avatar fayeed commented on June 23, 2024

@thevzurd I just tested on a device with 240x432 resolution and also a 480x800 and it works perfectly.

Screenshot_1571763596
240x432

Can you show me your code?

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024
class _ChatFeedBody extends StatefulWidget {
  const _ChatFeedBody({this.user, this.conversationsId});
  final ChatUser user;
  final String conversationsId;
  @override
  _ChatFeedBodyState createState() => _ChatFeedBodyState();
}

class _ChatFeedBodyState extends State<_ChatFeedBody> {
  final GlobalKey<DashChatState> _chatViewKey = GlobalKey<DashChatState>();

  @override
  Widget build(BuildContext context) {
    return StreamBuilder<List<Chat>>(
      stream: Provider.of<ChatBloc>(context).getChats(),
      builder: (BuildContext context, AsyncSnapshot<List<Chat>> snapshot) {
        if (!snapshot.hasData) {
          return Center(
            child: CircularProgressIndicator(
              valueColor: AlwaysStoppedAnimation<Color>(
                Theme.of(context).primaryColor,
              ),
            ),
          );
        } else {
          List<ChatMessage> messages = snapshot.data
              .map((Chat chat) => ChatMessage(
                    id: chat.id.id,
                    text: chat.text,
                    user: ChatUser(
                      uid: chat.user.id.id,
                      name: chat.user.displayName,
                      avatar: chat.user.avatarURL,
                    ),
                    image: chat.attachmentType == AttachmentType.image
                        ? chat.attachmentUrl
                        : '',
                    vedio: chat.attachmentType == AttachmentType.video
                        ? chat.attachmentUrl
                        : '',
                    createdAt: chat.createdAt,
/*                     quickReplies: QuickReplies(
                      values: <Reply>[
                        Reply(
                          title: "😋 Yes",
                          value: "Yes",
                        ),
                        Reply(
                          title: "😞 Nope. What?",
                          value: "no",
                        ),
                      ],
                    ), */
                  ))
              .toList();

          return DashChat(
            key: _chatViewKey,
            inverted: false,
            onSend: (ChatMessage message) {},
            user: widget.user,
            inputDecoration:
                InputDecoration.collapsed(hintText: 'Add message here...'),
            dateFormat: DateFormat('yyyy-MMM-dd'),
            timeFormat: DateFormat('HH:mm'),
            messages: messages,
            showUserAvatar: true,
            showAvatarForEveryMessage: false,
            scrollToBottom: false,
            onPressAvatar: (ChatUser user) {
              print('OnPressAvatar: ${user.name}');
            },
            onLongPressAvatar: (ChatUser user) {
              print('OnLongPressAvatar: ${user.name}');
            },
            inputMaxLines: 5,
            messageContainerPadding:
                const EdgeInsets.only(left: 5.0, right: 5.0),
            alwaysShowSend: true,
            inputTextStyle: TextStyle(fontSize: 16.0),
            inputContainerStyle: BoxDecoration(
              border: Border.all(width: 0.0),
              color: Colors.white,
            ),
            onQuickReply: (Reply reply) {
              setState(
                () {
                  messages.add(
                    ChatMessage(
                        text: reply.value,
                        createdAt: DateTime.now(),
                        user: widget.user),
                  );
// ignore: sdk_version_ui_as_code
                  messages = <ChatMessage>[...messages];
                },
              );
            },
          );
        }
      },
    );
  }
}

from dash_chat.

fayeed avatar fayeed commented on June 23, 2024

@thevzurd so there are two things first is that empty space below the text message it is because you are setting the image and vedio property of ChatMessage to empty string it needs to be null.

The second problem is that you are setting the showUserAvatar to true which was breaking the UI anway I have fixed that too, checked the new version 1.0.8.

from dash_chat.

thevzurd avatar thevzurd commented on June 23, 2024

image

Working now... thanks

from dash_chat.

Related Issues (20)

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.