Skip to content

Custom SliverAppBar with elements inside changing position or opacity #28081

@mattermoran

Description

@mattermoran

So here's the example of what I'm trying to achieve
1_pxoer2z45hyyflzhhqbq8w

As you can see the title scales down as user scrolls up. What I would also like to do is to change the position (like the text would in the center and as user scrolls it would move to the top left corner next to back button) or change opacity on scroll.
I don't think I can do that with default SliverAppBar so I thought I could do that with SliverPersistentHeader but I'm not sure how to proceed from there. I see that I can use ScrollPosition but I don't see any kind of event like onScroll with values in px.
So my question is am I doing something wrong or if not how do I continue?
Upd: here's the gist link with what I have right now
https://gist.github.com/mattermoran/d734ac4dae546b2f7ca194b5915a3832

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions