)]}'
{
  "commit": "b3aeefba76ed033b5feebe21eac611c76ce81eeb",
  "tree": "d4247403fea3afe1fb271a0da6c4b3e8705c5759",
  "parents": [
    "dddb028dec485746f69483f322a7c1841c56b4df"
  ],
  "author": {
    "name": "Ben Konyi",
    "email": "bkonyi@google.com",
    "time": "Fri Oct 02 02:15:20 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Oct 02 02:15:20 2026 +0000"
  },
  "message": "[Widget Preview] Provide descriptive error when widget preview is unconstrained (#193005)\n\n## Description\n\nWhen a developer previews a widget that expects finite parent\nconstraints (such as `SizedBox.expand` or expanding flex layouts), the\npreview scaffold previously crashed with cryptic `BoxConstraints forces\nan infinite width/height` assertions and secondary cascading failures\n(such as `hasSize` assertions and semantics traversal errors).\n\nThis PR improves the error handling when previews are rendered under\nunconstrained dimensions:\n- Intercepts unconstrained layout errors in the scaffold\u0027s\n`FlutterError.onError` handler and presents a structured `FlutterError`\nexplaining that previews are unconstrained by default and directing\ndevelopers to `@Preview(size: Size(width, height))` or explicit wrapper\ndimensions.\n- Traps layout exceptions at the preview card boundary\n(`_WidgetPreviewWrapperBox`), preventing secondary layout, paint, or\nsemantics assertion cascades.\n- Renders `WidgetPreviewErrorWidget` locally for the affected preview\ncard so the rest of the preview environment remains interactive.\n\n## Related Issue\nFixes https://github.com/flutter/flutter/issues/192712\n\n## Tests\n- Added regression test in\n`dev/integration_tests/widget_preview_scaffold/test/error_widget_test.dart`.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3af964409cf018c669e05db4ad7018a16408b87a",
      "old_mode": 33188,
      "old_path": "dev/integration_tests/widget_preview_scaffold/lib/src/widget_preview_rendering.dart",
      "new_id": "482aee29fa55263e08562e098f66fb0d5fb75c67",
      "new_mode": 33188,
      "new_path": "dev/integration_tests/widget_preview_scaffold/lib/src/widget_preview_rendering.dart"
    },
    {
      "type": "modify",
      "old_id": "706561178a88dace6a14382a21ec7c5af3b66bd7",
      "old_mode": 33188,
      "old_path": "dev/integration_tests/widget_preview_scaffold/test/error_widget_test.dart",
      "new_id": "2272db468eaf7e761f26564f2608b8dec2490785",
      "new_mode": 33188,
      "new_path": "dev/integration_tests/widget_preview_scaffold/test/error_widget_test.dart"
    },
    {
      "type": "modify",
      "old_id": "3af964409cf018c669e05db4ad7018a16408b87a",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/templates/widget_preview_scaffold/lib/src/widget_preview_rendering.dart.tmpl",
      "new_id": "482aee29fa55263e08562e098f66fb0d5fb75c67",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/templates/widget_preview_scaffold/lib/src/widget_preview_rendering.dart.tmpl"
    }
  ]
}
