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

SliverAppBar does not support title bar and bottom bar with different behaviors #8157

Closed
jiajiabingcheng opened this issue Feb 14, 2017 · 8 comments · Fixed by #8345
Closed
Assignees

Comments

@jiajiabingcheng
Copy link
Contributor

@Hixie

When using a SliverAppBar in CustomScrollView (in the body attribute of the Scaffold), is it possible to have the title bar and the bottom bar with different behaviors? Say I would to have the title bar floating and the bottom bar pinned.

See #5126.

Thanks :)

@Hixie
Copy link
Contributor

Hixie commented Feb 15, 2017

Bottom bars don't scroll, so they just don't go in the scroll view and are a non-issue.

The general answer though is yes, you can put whatever you want in a CustomScrollview.

@jiajiabingcheng
Copy link
Contributor Author

Hi Hixie,
I mean the bottom attribute in the SliverAppBar. There are a title and bottom attributes in AliverAppBar. I need the title part floating but the bottom part pinned in the same SliverAppBar.

@Hixie
Copy link
Contributor

Hixie commented Feb 15, 2017

Ah, I see. You can have two sliver app bars each with the behaviour you want, side by side. does that handle your case?

@jiajiabingcheng
Copy link
Contributor Author

I tried that, but the sliver app bar always carries a title part in the ui. If using two bars, it will show two title area, one of them is empty, and a bottom after that. Is it possible to hide the title part?

@Hixie
Copy link
Contributor

Hixie commented Feb 16, 2017

Sounds like you probably want a SliverAppBar for the top one, and then a SliverPersistentHeader for the second (with a custom delegate). Sorry, this area isn't well documented yet. We are still actively rolling this stuff out and polishing it.

@jiajiabingcheng
Copy link
Contributor Author

Thanks Hixie.

This worked. But when the top bar (SliverAppBar) is up out of the screen, the fixed bar (SliverPersistentHeader) starts from the top of the screen. It should start below the bottom of the notification tree.

Also using two bars as the app bar might not be a good idea, since we might need to add a shadow or change something later. Will the SliverAppBar support different behaviors of its attributes later?

@Hixie
Copy link
Contributor

Hixie commented Feb 16, 2017

I'm not really sure I understand your second paragraph. Can you show what you mean with a picture?

Generally speaking, SliverAppBar will support the common behaviors. It's just built with SliverPersistentHeader, so anything you can do with SliverAppBar you can do with SliverPersistentHeader. What new features we will support in the higher-level SliverAppBar isn't something we've had time to consider yet.

Having two slivers should be fine in general, but it probably depends on exactly what effect you want.

@github-actions
Copy link

github-actions bot commented Sep 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants