Which widget combines multiple slivers into a scrollable area?
CustomScrollView takes a list of Sliver widgets and combines them into a single scrollable area.
Build complex scrolling layouts with Slivers
You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.
Having trouble? AI is here to help
Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.
Use the AI button at the bottom of the screen
Slivers are the building blocks of scrolling in Flutter. They allow you to create complex scrollable layouts with collapsing headers, sticky elements, and mixed content types. Unlike simple ListView or GridView widgets, Slivers give you fine-grained control over how each section of a scrollable area behaves, making them essential for professional-grade scrolling experiences.
1// ── CustomScrollView with Slivers ──2CustomScrollView(3slivers: [4// Collapsing app bar5SliverAppBar(6expandedHeight: 200,7floating: false,8pinned: true,9flexibleSpace: FlexibleSpaceBar(10title: const Text('My App'),11background: Image.network('https://...', fit: BoxFit.cover),12),13),1415// Sticky header16SliverPersistentHeader(17pinned: true,18delegate: _StickyHeaderDelegate(19child: Container(20color: Colors.blue,21child: const Center(child: Text('Section Header')),22),23maxHeight: 60,24minHeight: 60,25),26),2728// Grid inside scroll view29SliverGrid(30gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(31crossAxisCount: 2,32mainAxisSpacing: 8,33crossAxisSpacing: 8,34),35delegate: SliverChildBuilderDelegate(36(context, i) => Card(child: Center(child: Text('Item $i'))),37childCount: 10,38),39),4041// List inside scroll view42SliverList(43delegate: SliverChildBuilderDelegate(44(context, i) => ListTile(title: Text('List Item $i')),45childCount: 20,46),47),4849// Fixed content50SliverToBoxAdapter(51child: Container(52height: 100,53color: Colors.amber,54child: const Center(child: Text('Footer')),55),56),57],58)
floating set to true makes the app bar appear when scrolling up. pinned set to true keeps the app bar visible in its collapsed form. snap set to true combined with floating makes the bar snap fully open or closed. Combine these properties for different scrolling behaviors.
Design sliver screens as scroll narratives:
Thoughtful composition improves both performance and information architecture.
Build complex scrolling layouts with Slivers. Widgets are reusable UI blocks. You combine them like LEGO pieces to build screens.
Operate with production and interview-level clarity.
Sketch the widget tree first, then code from top to bottom.
Most Flutter productivity comes from understanding layout rules and composing widgets cleanly.
Good widget composition is architecture at UI level, because it decides testability and reuse.
As your app grows, keep UI, state, and data responsibilities separate so each part stays testable and easier to modify.
CustomScrollView takes a list of Sliver widgets and combines them into a single scrollable area.
SliverToBoxAdapter wraps a regular box widget so it can be used inside a CustomScrollView with other slivers.
pinned: true keeps the collapsed app bar pinned at the top, always visible even when scrolled.
Something seems incorrect, unclear, or missing? Let us know.
FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.
Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.
Sign in to continue with exercises and quiz for this lesson.
Sign In to Continue