How do I make my ListView.builder
be able to scroll to empty space both to the top and to the bottom?
For example,
If I understand it correctly, your best bet would be using a CustomScrollView
with an expandable space in the SliverAppBar
.
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
automaticallyImplyLeading: false, // gets rid of the back arrow
expandedHeight: 250, // the collapsible space you want to use
flexibleSpace: FlexibleSpaceBar(
background: Container(
color: Colors.transparent
),
),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
// put your widgetsList here
},
childCount: widgetsList.length,
),
),
]
),
);
}