-
Notifications
You must be signed in to change notification settings - Fork 72
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
FR: Support additional top bar customization (especially features based on scroll position) #349
Comments
Today, you can customize further the scrolling animation specs as explained in ReadMe. This is the API docs.
This is not there yet, but could be added. If you decide to be the contributor, I can guide you the action items.
Would this example help? cus_top.mov |
Thanks for the example! What I had in mind is slightly different - I want the top bar to be sticky (always visible), but for the color/shadow to change when the content has been scrolled. The end effect is that for modals with content that doesn't need to be scrolled, the top bar looks like a normal heading, and for modals that need scrolling we have a clear separation between header and content that only becomes visible when scrolling. If this doesn't exist I'm happy to be guided on action items, and I'll contribute when I can find the time. |
Ok, let's try this:
not sure if this is gonna work, but I have a feeling like it should. PLease let me know. |
Hey, sorry for the late response on this, took a detour for other features in the app. I tried this out, but IIUC NotificationListener only listens to notifications that bubble up from its children - did you want me to add this somewhere in the WoltModalSheet code? Otherwise, I wasn't sure how to listen to the modal scroll - for example, using the |
Alternatively, if it's more straightforward is there a way to set the max height constraints of the modal such that the "modal content" never scrolls but I can write my own header and SingleChildScrollView (with ScrollController) and control the logic that way? I tried simply using |
Have you seen NonScrollingWoltModalPage |
|
Sorry, I closed this issue via misclick - could this be reopened?
When I try to use this, all my modals become max height by default even if the content is short. I think the closest behavior to what I'm trying to accomplish is having the following:
Where The issue with this approach is that the maxHeight has to be defined manually and if it's greater than the max height of the modal sheet, part of the content gets cut off - is there a way to match the constraints of the modal sheet without explicitly setting our own max height?
In this case, do you mean providing a |
This is because you have a Flexible widget in your child (Row, Column). You can try SingleChildScrollView with shrinkWrap true if your list is not huge. A better way of achieving this behavior is using modalTypeBuilder where you can use your own modal with custom layout constraints. this is what you have. WoltModalSheetPage(
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 17 / 20),
child: [...] ))) I suggest this: |
Sadly there's no shrinkWrap property in SingleChildScrollView. (edit: actually using ListView with Thanks for the link to modal page types - it looks like that would be a good route to go if I wanted to change the modal sheet layout constraints. But if I'm happy with the 90% max height that the modal sheet provides by default, is there any way to make sure those constraints get sent down to the child? It seems like this is done in the |
Today the top bar can only be customized somewhat. You can insert a custom widget into the
top_bar
field but it's limiting - even the padding isn't customizable. Top requests for improving usage of top bar:The text was updated successfully, but these errors were encountered: