Building scrolling experiences in Flutter | Workshop
Why Stack Overflow recommends it
Stack Overflow users link it when answering Flutter questions about CustomScrollView, SliverAppBar and nested scrolling, as the go-to walkthrough of slivers.
Recommended by 3 people across 4 different months, 2022 to 2025.
What it is
A 37-minute Google I/O 2021 workshop from the Flutter team, presented by Kate Lovett, on building rich scrolling experiences with slivers. It follows a DartPad-based codelab and explains how slivers differ from ordinary widgets, aimed at developers with some Flutter experience.
What people said
Recommends Md. Yeasin Sheikh · 2022-01 · Stack Overflow · on “Animated Container with scrolling list - Flutter”
This is using SliverAppBar [LINK] with expandedHeight . I will encourage checking this video [this video] . @override Widget build(BuildContext context) { return Scaffold( body: LayoutBuilder( builder: (context, constraints) => CustomScrollView( slivers: [ SliverAppBar( pinned: true, expandedHeight: constraints.maxHeight * .3, flexibleSpace: FlexibleSpaceBar( centerTitle: true, title: Text("Title"), background: Container( color: Colors.pink, ), ), ), SliverToBoxAdapter( child: Container( height: constraints.maxHeight * 4, color: Colors.deepOrange, ), ) ], ), ), ); }
Recommends Md. Yeasin Sheikh · 2022-07 · Stack Overflow · on “Make one part of stack scroll over another part”
You can use backgroundColor:red in this case. return Scaffold( backgroundColor: Colors.red, body: SingleChildScrollView( child: Column( children: [ SizedBox( height: 200, ), // your widgets here/ or just top level space Container( height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( color: Color.fromRGBO(250, 250, 250, 1), borderRadius: BorderRadius.only( topLeft: Radius.circular(48), topRight: Radius.circular(48)), ), ), ], ), ), ); Perhaps you need CustomScrollView [LINK] for more effect. Follow this video [this video] class OverlayFX extends StatelessWidget { const OverlayFX({Key? key}) : super(key: key); @override Widget build(
Recommends Md. Yeasin Sheikh · 2022-07 · Stack Overflow · on “How to make SingleChildScrollView fill full screen height with blank space where required”
Well this is better to me, else you have calculated the size of items and making scrollable will give overflow. check the link, sliver are better than anything. You can check this video [this video]
Recommends Maxalkin · 2024-07 · Stack Overflow · on “flutter add widgets on top and bottom to a listview”
Avoid using accepted solution ! Avoid using ListView with nested ListView with shrinkWrap:true , as it's a potentially terrible performance hit . Use CustomScrollView instead. You can understand why by watching this short 4 minute YouTube video from the flutter team: [LINK] Also, if you have trouble migrating from ListView to CustomScrollView with SliverList , or if you're not too familiar with slivers , you can watch this video (from 18:13) , also made by the flutter team: [this video] Image of the example with CustomScrollView [LINK] And here's the example code: Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: CustomScrollView( slivers: [ const SliverToBoxAdapter( c
Recommends wembleyleach · 2025-01 · Stack Overflow · on “How to share the scrollbar between container and gridview in flutter?”
Here's another solution that avoids using shrinkWrap , because of its performance issues, but relies on slivers instead: CustomScrollView( slivers: <Widget>[ const SliverToBoxAdapter( child: Align( alignment: Alignment.centerLeft, child: Padding( padding: EdgeInsets.all(16.0), child: SizedBox(height: 16.0, child: Text("Some Title")), ), ), ), SliverGrid.builder( gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent( maxCrossAxisExtent: 120, ), itemBuilder: (context, index) { return Container( color: _randomColor(), ); }, itemCount: 100, ), ], ) Here's the DartPad link so that you can see the full solution in context play and around with the code to better understand how it works: [LIN
Cites Md. Yeasin Sheikh · 2022-10 · Stack Overflow · on “Why is my SliverAppBar not responding at all?”
You need to add more slivers on CustomScrollView , when the viewport is bigger than slivers height, you will get the effect. Try adding SliverList or other sliver, body: CustomScrollView( slivers: [ SliverAppBar( expandedHeight: 200, flexibleSpace: FlexibleSpaceBar( title: Text("title"), ), ), SliverToBoxAdapter( child: SizedBox( height: 3333, ), ) ], ), You can check this video [this video]
Cites Camron · 2023-01 · Stack Overflow · on “Flutter: how to lazily load list in full-page scroll”
In case it can be of help to anyone else, the solution is indeed to use a CustomScrollView with slivers that fit your need. More about the topic here [this video] . Also, the sliver_tools [LINK] package offers some additional slivers for more customisation to fit your needs. Here is a great tutorial [LINK] on that package. CustomScrollView( slivers: [ SliverAppBar(), SliverList(), SliverToBoxAdapter(), ] )
Cites Adam · 2023-11 · Stack Overflow · on “Title Alignment in Sliver SpaceFlexibleBar”
I'm very desperate. I'm new to flutter and following the tutorials in YT. There I came across following problem and wonder how I'm the only one. In the YouTube ( [this video] ) video one gets explained how to use sliver. I great tool for scrolling experiences I guess. But after following the tutorial and even visiting the solution on flutter.dev/go/sliver-workshop I cant get to align the title in the center. Code: Code [LINK] Picture: Horizons not aligned in the center [LINK]