A CustomScrollView lays out slivers. A normal ClipRRect expects a box child, so placing a sliver directly inside it mixes two layout protocols. Flutter 3.50 introduces dedicated sliver clipping widgets for this situation.
Choose the correct layout protocol
Use SliverClipRect for a rectangular clip and SliverClipRRect for rounded corners. A clip changes what is painted; it does not turn a box widget into a sliver or provide padding around the list.
This complete local example deliberately gives the list a visible background. Run it in a Flutter 3.50 project and scroll the entries under the pinned app bar.
In a local Flutter 3.50 app, keep the generated material_ui dependency (or add it with flutter pub add material_ui). This example uses the standalone design package.
import 'package:material_ui/material_ui.dart';
void main() => runApp(const MaterialApp(home: ClippedList()));
class ClippedList extends StatelessWidget {
const ClippedList({super.key});
@override
Widget build(BuildContext context) => Scaffold(
body: CustomScrollView(slivers: [
const SliverAppBar(
pinned: true,
expandedHeight: 130,
flexibleSpace: FlexibleSpaceBar(title: Text('Reading queue')),
),
SliverPadding(
padding: const EdgeInsets.all(16),
sliver: SliverClipRRect(
borderRadius: BorderRadius.circular(20),
sliver: SliverList.builder(
itemCount: 40,
itemBuilder: (context, index) => ColoredBox(
color: Theme.of(context).colorScheme.surfaceContainerHighest,
child: ListTile(title: Text('Lesson ${index + 1}')),
),
),
),
),
]),
);
}
Why these wrappers are in this order
The outer SliverPadding creates spacing in the scrollable area. The clipping widget receives the list as its sliver, preserving the sliver constraints through the tree. Each builder result is a box, which is correct because SliverList creates the adapter boundary for individual items.
Keep the list lazy. Replacing it with a giant prebuilt Column may appear to solve a type problem while removing the reason for using slivers in the first place.
Inspect the pinned-header boundary
Scroll slowly until the leading rounded edge meets the app bar. The current SliverClipRRect API also exposes overlap behavior for pinned slivers. Choose that behavior based on the intended visual result; defaults and advanced overlap controls are separate decisions.
Common mistakes
If the runtime reports an unexpected render-object type, inspect the nearest child versus sliver parameter. If no rounding is visible, check that the clipped content actually paints a background to the edge. If the whole screen scrolls in two independent directions, revisit the
single-viewport explanation
.
Exercise
Change the radius, scroll to the middle and rotate the viewport. Compare a rectangular clip with a rounded clip, then explain why clipping cannot fix an unbounded-height error.