-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow floating dateDivider to be above the messages #842
Comments
Hi @duzenko, Assuming I have understood your bug correctly, here is some more information about date dividers: The You can either choose to turn off the floating date dividers like this:
OR you can add some kind of background to the date dividers like this to not make it look overlapping with the messages:
Let me know if this makes sense or if you think I may have misunderstood the issue at hand. |
Thanks, the two workarounds are kinda obvious |
Hi @duzenko |
Use a Column instead of Stack |
we have a date divider in a column. In your screenshot |
"August 3" on top is in a stack |
Just for some clarification: Both date dividers exist at the same time by default - as shown in your screenshot. If you don't allow the floating date divider, it will still show as column instead of a stack. If this is still confusing, you can send us a basic wireframe for us to understand better. |
If the floating date is disabled then the first messages show up without date at all |
Hi @duzenko, Would having the first messages with the date solve your issue? |
I think so, however it's not very clear what you mean |
hey @duzenko showFloatingDateDivider: false,
headerBuilder: (context) {
final date = StreamChannel.of(context)
.channel
.state
?.messages
.first
.createdAt;
if (date == null) {
return const Offstage();
}
return DateDivider(
dateTime: date,
);
}, Let me know if that works for you |
I think that's an okayish workaround |
I don't think this makes a lot of sense, but I think I know how to help you with this |
@imtoori Would it be possible to provide
Happy to open a PR if you like: if (widget.showScrollToBottom) _buildScrollToBottom(),
if (widget.showFloatingDateDivider) ...{
Positioned(
...
);
}, |
@rohan20 do you want to hide the date divider? that's why you need it, right? |
@imtoori Yes. We want to set |
@imtoori Just checking if you have a decision on this? :) |
Hey @rohan20, we are happy to receive a PR for this. Thanks, |
Thanks @xsahil03x. I can do that. Can you please create a branch from the |
@xsahil03x I couldn't assign you as a reviewer (no rights I suppose), but here's the PR. Thanks! |
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
Android
What version are you using?
latest
What happened?
the custom floating date overlaps and blends with the messages
Steps to reproduce
Supporting info to reproduce
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: