dash_chat
dash_chat copied to clipboard
Date separator is wrong on inverted list
Describe the bug When inverted: true, date separator doesn't work as expected.
To Reproduce
- Add 2 messages, dates 2nd of August and 5th of August, current user
- Add one message, date 7th of August, other user
Expected behavior Three different date separators, only found 2 and with wrong date
Screenshots
First screenshot, inverted: true, where the problem occurs.
Second screenshot, inverted: false, all ok.
- OS: Mac
- Device: Samsung Galaxy S9
- Flutter Version: Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.5)
- Dart Version: 2.9.0
- Dash Chat Version: 1.1.14
Changing the date of most recent message to two weeks ago, the problem shows too
@SebastienBtr any comments on this bug?
it seems to appear only for the first message, I didn't have time to check the code so I don't know exactly why it happens. I'll check that when I have more time. There is multiple issues with the date separator apparently, I'd honestly suggest to maybe not use it and wait for the v2. Anyway your issue is maybe quick to fix so I'll keep you updated.
Ok, thanks!
El 18 ago 2020, a las 12:17, SebastienBtr [email protected] escribió:
it seems to appear only for the first message, I didn't have time to check the code so I don't know exactly why it happens. I'll check that when I have more time. There is multiple issues with the date separator apparently, I'd honestly suggest to maybe not use it and wait for the v2. Anyway your issue is maybe quick to fix so I'll keep you updated.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fayeed/dash_chat/issues/124#issuecomment-675393063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMALDHRASM5WF4OK3EU7ATSBJIKNANCNFSM4PXNKCFQ.
You can also use a sorting function based on date to fix it, with something like this:
messages.sort((messageA, messageB) => messageB.createdAt.compareTo(messageA.createdAt));