Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter sliver container

I'm new to flutter and I'm not able to achieve the layout I want.

I have one sliverAppBar with 3 tabs. The content of one of the tabs has to be a ScrollView compound by one container with fixed size(with an image as background) and a ListView.

I've tried to do this with a CustomScrollView but I don't know how to create the container as it is not a sliver.

Can you point me in the right direction?

Regards, Diego.

like image 880
niegus Avatar asked Feb 16 '19 18:02

niegus


People also ask

How do you use slivers in flutter?

How to use slivers? It is to note that all of the sliver's components should always be placed inside a CustomScrollView. After that, we can combine the list of slivers to make the custom scrollable area.

What is sliver list in flutter?

In Flutter, with slivers, we can create different scrolling effects. Slivers give an amazing view of the lists when they scroll up or down. The slivers allow us to impact the Lists, Grids scrolling experience.

What is SliverFillRemaining?

SliverFillRemaining will size its child to fill the viewport in the main axis if that space is larger than the child's extent, and the amount of space that has been scrolled beforehand has not exceeded the main axis extent of the viewport.

What is silver to box adapter?

Slivers are special-purpose widgets that can be combined using a CustomScrollView to create custom scroll effects. A SliverToBoxAdapter is a basic sliver that creates a bridge back to one of the usual box-based widgets.


1 Answers

You can simply use SliverToBoxAdapter :

SliverToBoxAdapter(      child: Container(..), ) 
like image 142
anmol.majhail Avatar answered Nov 23 '22 00:11

anmol.majhail