TatsuUkraine / flutter_sticky_infinite_list

Multi directional infinite list with Sticky headers for Flutter applications
BSD 2-Clause "Simplified" License
341 stars 31 forks source link

What is the best approach to stick one widget on scroll #17

Closed ycgambo closed 5 years ago

ycgambo commented 5 years ago

I want to stick the pink area. Should I use CustomScrollView instead of Scaffold? What are the features that CustomScrollView provides but Scaffold doesn't?

image

TatsuUkraine commented 5 years ago

CustomScrollView is just one of the many scrolling widgets (like SliverList or singlechildscrollview), so it's not a replacement for scaffold in any mean, it's just a different widget

As for your example. Recently I added example, how to use StickyListItem as standalone widget and also I updated example project with this example. https://github.com/TatsuUkraine/flutter_sticky_infinite_list/blob/master/README.md#need-more-override

TatsuUkraine commented 5 years ago

@ycgambo But in your particular example I'm not sure that you actually need to use my package. You can simply place scrolling widget below pink area

TatsuUkraine commented 5 years ago

@ycgambo so like an example it could be Column with 3 children, first one - row above pink widget, second one - will be pink one. And third one - flexible with flex === 1 and child - grid view (or maybe third-party) widget

TatsuUkraine commented 5 years ago

In that way scroll area will be section after pink widget, so pink widget will behave like sticky since it won't be scrolled

ycgambo commented 5 years ago

Thank you, these info really helps a lot. I'll try it out. thanks.

ycgambo commented 5 years ago

Sorry, I didn't make myself clear.

Here is a real app screen record.

How will you build the menu animation in flutter?

2019-09-19 21 45 31

TatsuUkraine commented 5 years ago

Probably you can achieve this type of behavior with SliverList + SliverAppBar + TabBar. Obviously you will need to provide own sized widget. At least from what I see in a screenrecord , I think it will be enough to use widget, that I listed above)

ycgambo commented 5 years ago

Thanks. I’ll try it out.