Skip to content
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

Open
auradigitaldev opened this issue Dec 13, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@auradigitaldev
Copy link

auradigitaldev commented Dec 13, 2024

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:

  1. Add support for top bar divider behavior on scroll, i.e. only showing the top bar shadow when the page is not in the default scroll position.
  2. Allow the user to provide different/custom top bar dividers, other than the elevation shadow currently provided (e.g. if the user wants to use a hairline or gradual linear gradient fade to separate the top bar from the page instead of a shadow, or use Google's material approach where there entire top bar changes color when leaving the default scroll position)
@auradigitaldev auradigitaldev added the enhancement New feature or request label Dec 13, 2024
@ulusoyca
Copy link
Collaborator

Today, you can customize further the scrolling animation specs as explained in ReadMe. This is the API docs.

only showing the top bar shadow

This is not there yet, but could be added. If you decide to be the contributor, I can guide you the action items.

Allow the user to provide different/custom top bar dividers, other than the elevation shadow currently provided (e.g. if the user wants to use a hairline or gradual linear gradient fade to separate the top bar from the page instead of a shadow, or use Google's material approach where there entire top bar changes color when leaving the default scroll position)

Would this example help?

cus_top.mov

@auradigitaldev
Copy link
Author

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.

@ulusoyca
Copy link
Collaborator

ulusoyca commented Dec 20, 2024

Ok, let's try this:

  1. Provide a custom top bar
  2. Wrap the custom top bar with Theme widget and add WoltModalSheetThemeData extension as in this example: link
  3. Wrap the theme widget with NotificationListener(link) and listen for scroll events.
  4. Rebuild the the theme widget and assign [this] value of the extension data (https://github.com/woltapp/wolt_modal_sheet/blob/main/lib/src/theme/wolt_modal_sheet_theme_data.dart#L17) value: topBarShadowColor

not sure if this is gonna work, but I have a feeling like it should. PLease let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants