1. The Problem
Is there a way for a ListView.builder
to start, say, at the second (index = 1
) item of a list of widgets?
In my case — more info here and here if you're interested —, I'm trying to add some empty space at the top of a ListView
so the user can scroll the top card closer to his thumb. A workaround would be to add empty Container
s to the top and bottom of the List
of widgets to simulate empty space. However, the ListView
will render the Container
s on the screen and user might become confused and not know that there are more cards available by simply scrolling.
Maybe there is a way of doing this with a ScrollController
?
2. Some Template Code
I don't think that exposing code will help much because I'm just using a typical ListView.builder
, but here it is in case you need a refresher.
ListView.builder(
itemCount: widgetsList.length,
itemBuilder: (context, index){
return widgetsList[index];
},
),