Tuesday, December 4, 2018

Flutter : What is a Sliver

Sliver is just a portion of a scrollable area. That’s it! Under the covers, all of the scrollable views you use, like ListView and GridView, are actually implemented using Slivers. You can kind of think of Slivers as a lower-level interface, providing finer-grained control on implementing scrollable area. Because slivers can lazily build each item just as it scrolls into view, slivers are particularly useful for efficiently scrolling through large numbers of children.

You might want this additional control in scrolling behavior if you:

    Want an app bar with nonstandard behavior (disappearing as you scroll, changing size or color as you scroll, etc).
    Need to scroll a list of items and a grid of items all together as one unit. (Yes, you can do this with a table in a ListView but that is much less efficient, particularly if you have a large table.)
    Do something weird like a collapsing list with headers (see gif on the right at the top of this page).

References
https://medium.com/flutter-io/slivers-demystified-6ff68ab0296f

No comments:

Post a Comment