Repository navigation
Description
Steps to reproduce
This reproduces in a new, otherwise empty Flutter project and when the previewer is started directly in Chrome. No IDE is involved.
- Run
flutter create --empty --project-name preview_group_repro preview_group_repro. - Replace
lib/main.dartwith the code sample below. - Run
flutter widget-preview start --no-pub --web-server. - Open the printed URL in Chrome.
- Collapse the
Probegroup, then expand it again.
Expected results
The group should expand and restore both previews without throwing an exception.
Actual results
The first preview becomes a red error surface and the browser console reports:
TypeError: true: type 'bool' is not a subtype of type 'double?'
This also occurs when running flutter widget-preview start --no-pub --web-server directly in Chrome, so VS Code is not required to reproduce it.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter/widget_previews.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(body: Center(child: Text('Hello World!'))),
);
}
}
@Preview(name: 'First', group: 'Probe', size: Size(360, 240))
Widget firstPreview() => const ColoredBox(color: Colors.teal);
@Preview(name: 'Second', group: 'Probe', size: Size(360, 240))
Widget secondPreview() => const ColoredBox(color: Colors.deepOrange);Screenshots or Video
Screenshot from the standalone Web Previewer
Captured immediately after step 5.
Logs
Logs
$ flutter analyze
Analyzing preview_group_repro...
No issues found!
$ flutter widget-preview start --no-pub --web-server
Creating widget preview scaffolding at: <project>/.widget_preview
Launching the Widget Preview Scaffold on Web Server...
Launching lib/main.dart on Web Server in debug mode...
lib/main.dart is being served at http://localhost:<port>
Browser console after expanding the group:
The following _TypeError was thrown building SingleChildScrollView:
TypeError: true: type 'bool' is not a subtype of type 'double?'
The relevant error-causing widget was:
SingleChildScrollView
SingleChildScrollView:<project>/.widget_preview/lib/src/widget_preview_rendering.dart:781:16
Stack (relevant frames):
package:flutter/src/widgets/scroll_position.dart 538:90 restoreScrollOffset
package:flutter/src/widgets/scroll_controller.dart 307:12 createScrollPosition
package:flutter/src/widgets/scrollable.dart 674:5 didChangeDependenciesThe generated scaffold uses ExpansionTile(key: PageStorageKey(group.name)) at widget_preview_rendering.dart:279-280. The failing SingleChildScrollView is at line 781. ScrollPosition.restoreScrollOffset reads PageStorage state as double? at scroll_position.dart:538, so this appears to be a PageStorage state collision between the group expansion state and the descendant scrollable offset.
Related: #97583 describes the underlying PageStorage type collision. Grouping support was introduced in #174849.
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.47.0, on macOS darwin-arm64, locale zh-Hans-CN)
• Framework revision 4cf2416426 (2026-08-11)
• Engine revision 5f77625673
• Dart version 3.13.0
• DevTools version 2.60.0
[✓] Chrome - develop for the web
• Google Chrome 151.0.7922.138
[✓] Network resources
• All expected network resources are available.
• No issues found!(The connected-device section is omitted because this reproduces on the Web Previewer and contains local device identifiers.)
Activity
suryaKommana2662 commentedon Aug 18, 2026
@shell-echo Thanks for the detailed reproduction steps and minimal example. I was able to reproduce the issue on Flutter 3.47.0 using the standalone Widget Previewer with Chrome. When collapsing and expanding the Probe preview group, the first preview displays an error, as shown in the attached screenshot.

I also tested the same reproduction on Flutter 3.44.7, but I was unable to reproduce the issue there. This indicates that the issue is reproducible on Flutter 3.47.0 but not on 3.44.7. Routing this issue to
team-toolfor further investigation.[Widget Preview] Isolate PageStorage scope in widget preview group ex…
github-actions commentedon Sep 4, 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.