Skip to content

added support for hiding header onListViewScroll #2041

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

M-Taha-Dev
Copy link
Contributor

@M-Taha-Dev M-Taha-Dev commented Jun 24, 2025

Added support for hiding header when a user scrolls in listview.

  • added a new function buildScrollablePageContentWithCollapsableHeader that will be invoked only if we have set collapsableHeader property true in header styles

  • when header collaps, body exceeds the defined SafeArea, to prevent this, I've added safe area for this scenario as well. we will need to set collapseSafeArea to true in header styles

  • also added floating property to AnimationHeader

@M-Taha-Dev
Copy link
Contributor Author

sample.mp4

: buildFixedPageContent(fixedAppBar != null),
footer: footerWidget,
),
body: FooterLayout(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please format the code.

} else {
externalScrollController = ScrollController();
persistentControllers[currentPageKey!] = externalScrollController!;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this if-and-else is having the same thing happening?

final scrollingDown = currentOffset < _previousOffset;

if (scrollingUp) {
currentExternalScrollController!.animateTo(100, duration: const Duration(milliseconds: 16), curve: Curves.linear);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the values from animation map and then have these as default values if not given.

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

Successfully merging this pull request may close these issues.

2 participants