SliverList & SliverGrid (Flutter Widget of the Week)

Google for Developers · 407K views · 2018 · 1:26

Open on YouTube

Web developmentSoftware (other)tutorial

Why Stack Overflow recommends it

Stack Overflow users link it when someone needs a list and a grid, or several lists, to scroll together in a single Flutter screen instead of nesting scrollables.

Recommended by 6 people across 7 different months, 2018 to 2023.

What it is

A 1.5-minute Flutter Widget of the Week episode from Google for Developers introducing SliverList and SliverGrid. It explains how slivers let lists and grids scroll together inside one scroll view and build children lazily or ahead of time.

What people said

Recommends Sasikanth · 2019-10 · Stack Overflow · on “Two list on a single flutter screen”

If you're looking for a list and grid to scroll together in single screen. I suggest you take a look at SliverList & SliverGrid . [this video] Basic example is @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Flutter Slivers'), ), body: _buildSlivers(), ); } Widget _buildSlivers() { return CustomScrollView( slivers: <Widget>[ SliverGrid.count( crossAxisCount: 3, children: _gridItems(), ), SliverList(delegate: SliverChildBuilderDelegate((context, index) { return ListTile( title: Text('Item $index'), ); })) ], ); } This would generate the following results. [LINK] Flutter docs: [LINK]

Recommends MickaelHrndz · 2020-07 · Stack Overflow · on “How can I place correctly GridView, ListView and Column?”

You might want to consider slivers . It allows you to combine lists, grids and other elements into a single scrollable widget. It also includes some cool features like the SliverAppBar with flexible space that shrinks as you scroll down. Check those links out : Youtube : SliverList & SliverGrid (Flutter Widget of the week) [this video] Medium : Flutter — Slivers and CustomScrollView [LINK]

Recommends CoderUni · 2020-09 · Stack Overflow · on “Unable to scroll ListView even with ScrollPhysics”

Also, shrinkWrapping your ListView.builder() is bad. You aren't making the ListView.builder() lazily build its children anymore since you are telling it to build everything first just to calculate its size. If I have a layout similar to yours, I would use Slivers. Check this out: [this video]

Recommends Csondor Bence · 2021-01 · Stack Overflow · on “Gridview.builder with Sticky headers”

I would use a Column which first child is the header and the second one is the GridView inside an Expanded widget. Something like this [LINK] . Or you can use slivers in a CustomScrollView . Short tutorial here [this video] .

Recommends CoderUni · 2021-05 · Stack Overflow · on “flutter SingleChildScrollView remove item”

I think what you're looking for is two `SliverList` inside a `CustomScrollView` so that you can have two different lists that scroll together. The first one would need to be a SliverList with a builder delegate. [this video]

Recommends XavierRenegadeAngel · 2022-03 · Stack Overflow · on “Flutter: Vertical Overflow Problems When Nesting Multiple Gridviews Inside Of Column”

I'm having trouble with managing vertical overflow in my Flutter application. Essentially, I have a main column with a container child that holds another column with 3 containers each containing a gridview : stateful widget Scaffold body: Center Column Container Column Container Gridview Container Gridview Container Gridview What I've Tried: Method 1: to try and solve the vertical overflow, I have tried wrapping the containers in expanded , but the problem with that is it smushes everything together and I want all the content of the gridviews to be displayed at full height, with the ability to scroll down through the main column . Method 2: so next i tried wrapping the main column in a singl

Recommends Canilho · 2023-08 · Stack Overflow · on “ListView with a single expanded tile at a time”

I don't think you want a ListView but instead, I think you might want to use a Silver List SliverList & SliverGrid [this video] If you still want to follow the ListView approach, you can look up this link on how to Create lists with different types of items [LINK] You must define your own build method, in order to define the structure of your items.

Cites Andrii Turkovskyi · 2018-10 · Stack Overflow · on “Sticky headers on SliverList”

I've seen new flutter video and seen some interesting. (It's not typical sticky header or expandable list, so I don't know how to name it) Video [this video] - watch from 0:20 Does anybody know how can I create such type of list with headers using SliverList? [LINK]

Cites Tim Klingeleers · 2019-06 · Stack Overflow · on “How to make all the list views scrollable at the same time?”

Take a look at the SliverList widget. It allows you to scroll multiple listviews at once. Or perhaps I misunderstood the question and you want to scroll them in sync? References: Widget of the week on YouTube [this video] Flutter documentation [LINK]

Cites MickaelHrndz · 2021-01 · Stack Overflow · on “Add a seperator after a fixed number of widgets in a grid”

This should work : Wrap your item with Column(mainAxisSize: MainAxisSize.min) Put this after the item : if(index != 0 && index % 200 == 0) YourContainer(), EDIT : just remembered the GridView 's childAspectRatio thing. It will force the size of every cell, so you can't add space. You might want to take a look at slivers [this video]