Flutter Golden Tests — Catch UI Regressions with Snapshot Testing Golden tests save a "expected UI image" and automatically compare it against future renders. They catch design regressions in CI before they ship. Basic Golden Test testWidgets ( 'PricingCard goldentest' , ( tester ) async { await tester . pumpWidget ( MaterialApp ( home: Scaffold ( body: PricingCard ( plan: PricingPlan ( name: 'Pro' , price: 2980 , highlight: true ), ), ), ), ); await expectLater ( find . byType ( PricingCard ), matchesGoldenFile ( 'goldens/pricing_card_pro.png' ), ); }); Enter fullscreen mode Exit fullscreen mode First run with flutter test --update-goldens generates the PNG. Subsequent runs fail on any visual diff.…