-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Nested SliverStickyHeader #5
Comments
Hi @bunopus, thanks for the feedback 😃. |
I found how to do it 😁! It's a little bit complex since you'll have to play with You can find the entire code for the view above here: https://gist.github.com/letsar/2e3cc98d328b3e84170abacf154e545f |
@letsar Wow! 😍 |
You're welcome 😄 . |
Tried your solution, and noticed one thing: app bar title ("Main AppBar") remains on the screen with tab bar. It's not exactly what i want. I think user don't need to see title all the time. In the original Google IO app (in first post) app bar title hides when user scrolls page. Maybe you know how to achieve that? Found PR flutter/flutter#8345 and it says that you can pass |
Achieved this by adding another |
Your're welcome and yes you're right it's not exactly what you wanted but it's more a |
@bunopus You said you achieved this by adding another SliverAppBar but this means you have 2 SliverAppBars? Your gist link code gives me 2 x bars. https://gist.github.com/bunopus/4a99dc9def2932e0aff2629f3905093a#file-tab_bar_view-dart-L36-L39 How did you make sure the second SliverAppBar ONLY has the TabBar in it? |
|
Thanks @bunopus looks like that might be the only option at this stage. I can get it to work just like the Google I/O app where the AppBar bit of the SliverAppBar does in fact scroll off screen leaving just the TabBar pinned. To see this use this code in this issue: flutter/flutter#17518 , but with SliverAppBar having floating, pinned and snap all set to true. !!! But as soon as I add flutter_sticky_header package inside a CustomScrollView as part of the TabBarView it stops working ie. AppBar bit of SliverAppBar no longer scrolls off screen. So it seems like you can have either the floating app bar at the top OR sticky headers, but not both. |
This fork has commits related to nested SliverStickyHeader :) |
Is there an updated solution for this issue? This does not appear to work when using tabs and the nested scroll view, I'm looking to be able to pin headers that are inside of a custom scroll view in a tab bar view in the body of a nested scroll view. |
When testing, my application crashed while changing tabs, because the handle did not remove listeners correctly. I needed to add the 'detach' function and remove the listener accordingly.
Here are the snippets if anyone is interested.
|
Thank you for your library, it's super useful. I have one question: Is it possible to achieve something like this:
As you can see header with dates sticks to the screen as well as the side header with time (it is a https://github.com/google/iosched app). Example app have great section with side headers, but i tried to nest
SliverStickyHeader
and it doesn't work. Second Header doesn't stick to screen.Code
The text was updated successfully, but these errors were encountered: