Repository navigation
Closed
flutter/packages
#12563Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.44Found to occur in 3.44Found to occur in 3.44has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
- Create an application using
CarouselView.weightedwithinfinite: false(which is the default). - Configure it with an asymmetric
flexWeightsarray that ends with a large base weight (e.g.[1, 7]). - Provide a small finite number of
children(e.g. 5 items). - Run the app and manually scroll/fling all the way to the end of the carousel.
Expected results
The CarouselView should scroll smoothly and gracefully stop at the boundary of the last item without throwing any rendering exceptions.
Actual results
The app does not crash entirely, but during the scroll/drag interaction it throws a SliverGeometry is not valid rendering exception in the logs, complaining that maxPaintExtent is less than paintExtent. Because the layout calculation is aborted, the scroll behavior becomes erratic, fighting the user or snapping weirdly.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Carousel Bug Repro')),
body: Column(
children: [
Expanded(
child: CarouselView.weighted(
flexWeights: const [1, 7],
children: List<Widget>.generate(
5,
(int index) => Container(
color: Colors.primaries[index % Colors.primaries.length],
child: Center(child: Text('Item $index', style: const TextStyle(fontSize: 24))),
),
),
),
),
],
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
SliverGeometry is not valid: The "maxPaintExtent" is less than the "paintExtent".
The maxPaintExtent is 606.0, but the paintExtent is 663.5.
By definition, a sliver can't paint more than the maximum that it can paint!
The RenderSliver that returned the offending geometry was: _RenderSliverWeightedCarousel#aae74 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
needs compositing
creator: _SliverWeightedCarousel ← Viewport ← IgnorePointer-[GlobalKey#941a7] ← Semantics ← Listener
← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#f66a1] ←
Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#e2e33] ←
NotificationListener<ScrollMetricsNotification> ← Transform ← ⋯
parentData: paintOffset=Offset(0.0, 0.0) (can use size)
constraints: SliverConstraints(AxisDirection.right, GrowthDirection.forward, ScrollDirection.idle,
scrollOffset: 461.5, precedingScrollExtent: 0.0, remainingPaintExtent: 750.0, crossAxisExtent:
1000.0, crossAxisDirection: AxisDirection.down, viewportMainAxisExtent: 750.0,
remainingCacheExtent: 750.0, cacheOrigin: -0.0)
geometry: SliverGeometry(scrollExtent: 606.0, paintExtent: 663.5, maxPaintExtent: 606.0,
hasVisualOverflow: true, cacheExtent: 663.5)
currently live children: 3 to 4Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.44.0, on macOS 26.5.1 25F80 darwin-arm64, locale
pt-BR) [673ms]
• Flutter version 3.44.0 on channel stable at
/Users/mairramersilva/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 559ffa3f75 (6 weeks ago), 2026-05-15 14:13:13 -0700
• Engine revision 4c525dac5e
• Dart version 3.12.0
• DevTools version 2.57.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop,
enable-windows-desktop, enable-android, enable-ios, cli-animations,
enable-native-assets, enable-swift-package-manager,
omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[2,1s]
• Android SDK at /Users/mairramersilva/Library/Android/sdk
• Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
• Platform android-36, build-tools 36.1.0
• ANDROID_HOME = /Users/mairramersilva/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/mairramersilva/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on
this machine.
To manually set the JDK path, use: `flutter config
--jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.0) [2,1s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A324
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [6,3s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.5.1 25F80 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 149.0.7827.116
[✓] Network resources [390ms]
• All expected network resources are available.
! Doctor found issues in 1 category.Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.44Found to occur in 3.44Found to occur in 3.44has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
mbcorona commentedon Jun 23, 2026
Hi @Mairramer , thanks for the detailed report and linked pr, routing to the design team for evaluation.
dkwingsmt commentedon Jun 24, 2026
FYI @QuncCccccc
[material_ui] Fix SliverGeometry maxPaintExtent assertion in Carousel…
[material_ui] Fix SliverGeometry maxPaintExtent assertion in Carousel…
[material_ui] Fix SliverGeometry maxPaintExtent assertion in Carousel…
github-actions commentedon Sep 21, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.