golden_screenshot
Utilities to automate screenshot generation using Flutter's golden tests.
12.0.0
18K downloads/mo
#2299 most downloaded on pub.dev
adil192/golden_screenshot
What this package is like to depend on
Last release 10 days ago
13 Aug 2026
Release timing varies
gaps range from 8 days to 5 months
Most releases are documented
notes for 45 of 51 stable releases
2 versions withdrawn
withdrawn after publishing
2 years old
53 releases · first in 2024
27 releases in the last 12 months
see the full history below
Release timeline
53 releases · Aug 2024 to Aug 2026Releases
latest 53-
12.0.013 Aug 2026Release notes
Open source →- Migrated to
material_uias the decoupled Material library from Flutter 3.47.0. - Bumped the minimum Flutter version to 3.47.0.
- Migrated to
-
11.0.120 Mar 2026Release notes
Open source →- Fixed the titlebar's font being invalid if you use a theme from the Yaru package.
-
11.0.020 Mar 2026Release notes
Open source →- Tweak: Flathub screenshots now better match stock Adwaita, with tweaks to the border radii, window shadows, and titlebar.
- Tweak:
ScreenshotConditionalTitlebarnow only applies to Linux (Flathub) devices and no longer applies to Windows devices. - Chore: Removed the dependency on the Yaru package.
-
10.0.118 Mar 2026 -
10.0.031 Jan 2026Release notes
Open source →- The Inter font has been replaced by InterNotoSansHybrid for much wider language support. You can see more details here: #10.
- I'm bumping the package version to 10.0.0 since this may result in some slight font spacing changes.
- If you need to use
MaterialApp/CupertinoAppand notScreenshotApp, you can wrap it withDeviceBoxwhich handles the resizing and media query stuff.
- The Inter font has been replaced by InterNotoSansHybrid for much wider language support. You can see more details here: #10.
-
9.1.209 Dec 2025Release notes
Open source →- Fixed an issue where
SelectableTextandEditableTextwidgets would not be found when looking for fonts in the widget tree.
- Fixed an issue where
-
9.1.108 Dec 2025Release notes
Open source →- Improved performance if
tester.loadAssets()is called multiple times by caching loaded font assets.
- Improved performance if
-
9.1.008 Dec 2025Release notes
Open source →- Replaced Roboto with the more modern Inter as the default fallback font.
- Renamed some parameters as necessary:
fontsToReplaceWithRobototofontsToMockkFontsToReplaceWithRobototokFontsToMock
-
9.0.108 Dec 2025Release notes
Open source →- Fixed an issue where some icon fonts were not found in
tester.loadAssets(). - Deprecated the
widgetTypeparameter oftester.loadAssets(). It is no longer needed or used.
- Fixed an issue where some icon fonts were not found in
-
9.0.007 Dec 2025 withdrawnRelease notes
Open source →Migration possibly needed: If some fonts are missing in your goldens after updating, you should pass the names of those fonts to the
alsoLoadTheseFontsparameter oftester.loadAssets(). See below for more details.- Only fonts found in the widget tree will be loaded now.
- This cut down golden_screenshot's testing time from ~25 seconds to ~15 seconds.
- The actual speedup may not be as dramatic in your app since it only reduces font loading in goldens (not unit tests or regular widget tests).
- Tests will also use less RAM now, especially critical for computers or CI systems with low memory.
- Added the
alsoLoadTheseFontsparameter totester.loadAssets(), allowing you to specify additional fonts to load beyond those found in the widget tree.- This is useful if you use fonts in ways that don't show up in the widget tree, e.g. inside a CustomPainter's paint function.
- Renamed some parameters for clarity:
overriddenFontstofontsToReplaceWithRobotokOverriddenFontstokFontsToReplaceWithRoboto
- Only fonts found in the widget tree will be loaded now.
-
8.2.006 Dec 2025Release notes
Open source →Features
- Apple devices now use the official San Francisco Pro fonts to match real devices.
- Due to licensing restrictions, these fonts are not bundled with the package.
- You need to run
dart run golden_screenshot:download_apple_fontsto download them. - If you haven't done this, Roboto will be used instead (just like before), and your tests will remind you to run the command.
- When using
ScreenshotApp, Flutter'sdefaultTargetPlatformis now overridden to match the device's platform.
Performance
- Only one copy of Roboto is stored in memory now. Previously, each font fallback had its own copy of Roboto which wasted RAM.
- Apple devices now use the official San Francisco Pro fonts to match real devices.
-
8.1.127 Nov 2025Nothing published for this version
-
8.1.011 Nov 2025Release notes
Open source →- The
ScreenshotConditionalTitlebarwidget now hides the minimise/maximize buttons by default on Linux/Flathub screenshots, to comply with Flathub's quality guidelines. - You can override this behaviour by passing
isMinimizable,isMaximizable, andisClosableparameters toScreenshotConditionalTitlebarorScreenshotApp.withConditionalTitlebar.
- The
-
8.0.105 Nov 2025Release notes
Open source →- If there's no images to precache,
tester.loadAssets()will no longer try to locate aBuildContext, avoiding unnecessary errors. - Simplified the example test code.
- If there's no images to precache,
-
8.0.005 Nov 2025Release notes
Open source →Migration needed: Remove any calls to
tester.useFuzzyComparator(), and make sure you're usingtestGoldensinstead oftestWidgets.testGoldensnow automatically enables the fuzzy comparator and shadow rendering, so you no longer need to calltester.useFuzzyComparator(). It is also no longer called insidetester.expectScreenshot(), so make sure you're usingtestGoldensto get the benefits.
-
7.2.005 Nov 2025Release notes
Open source →Migration recommended: Replace the deprecated precaching methods with
tester.loadAssets().- Added
tester.loadAssets(), replacing the previous methods for loading images and fonts. This method loads images and fonts at once, simplifying the API. - Deprecated
tester.loadFonts(),tester.precacheImagesInWidgetTree(), andtester.precacheTopbarImages(). Usetester.loadAssets()instead. - It is now optional to pass
allowedDiffPercenttotester.useFuzzyComparator(). If not provided, it defaults to 0.1 percent. - Added an example to the README of using a custom frame for more than just system UIs.
- Added
-
7.1.002 Nov 2025Release notes
Open source →- No need to use
ScreenshotConditionalTitlebarwidget directly anymore. Instead, use theScreenshotApp.withConditionalTitlebarconstructor to do the same thing with less code. - If you're subclassing
ScreenshotFrame, you must now provide thetopBarandbottomBarparameters in the constructor (they no longer default to null).
- No need to use
-
7.1.0+104 Nov 2025Nothing published for this version
-
7.0.102 Nov 2025Release notes
Open source →- Polished the README a little and added example screenshots to it.
- Updated the example/demo app to be prettier and have more flexible testing.
- Added an unnamed
ScreenshotFrame()constructor for easier subclassing.
-
7.0.1+102 Nov 2025Nothing published for this version
-
7.0.001 Nov 2025Release notes
Open source →-
The
flathubdevice was previously a combination of Flathub (Linux) and Play Store (Android) requirements. It has now been split into two separate devices:- The new
flathubdevice:- Has rounded corners and a shadow to match real Gnome screenshots.
- Screenshots are saved in
metadata/en-US/images/flathubScreenshots/. - I recommend you use a
ScreenshotConditionalTitlebar(see below) for a more native look.
- The new
androidTabletdevice:- Has a top and bottom bar matching Android 16 QPR1 (Material 3 Expressive) tablets.
- Screenshots are saved in
metadata/en-US/images/tenInchScreenshots/.
- The renamed
androidPhonedevice:- Exactly the same as
androidfrom before. - Migration can be done automatically with the
dart fixtool.
- Exactly the same as
- The new
-
Added the
ScreenshotConditionalTitlebarwidget, which adds a Yaru (Ubuntu) themed titlebar to Linux screenshots. <br/>(As of v7.1.0, prefer usingScreenshotApp.withConditionalTitlebarinstead of using this widget directly.)
-
-
6.0.023 Oct 2025Release notes
Open source →Migration needed: Update your goldens by running
flutter test --update-goldens.- Updated the top bars to Android 16 QPR1 (Material 3 Expressive) and iOS 26 (Liquid Glass).
- Switched the android device from the Pixel 6 Pro to the Pixel 9 Pro.
-
5.1.022 Oct 2025Release notes
Open source →- Fixed iOS fonts not being overridden in
tester.loadFonts. - Overridden a bunch more common system fonts: see
kOverriddenFontsfor the full list.
- Fixed iOS fonts not being overridden in
-
5.0.015 Oct 2025Release notes
Open source →Migration needed: Delete the
metadata/en-US/images/*Screenshotsfolders and rerunflutter test --update-goldens.- Apple no longer requires screenshots from
olderIphoneandolderIpad, so inGoldenScreenshotDevices:olderIphoneandolderIpadhave been removed.newerIphoneandnewerIphonehave been renamed toiphoneandipad.
- For non-user-facing goldens, you can now use
GoldenSmallDevicesinstead ofGoldenScreenshotDevices. It's the same but with a lower resolution, resulting in faster tests.
- Apple no longer requires screenshots from
-
5.0.0+117 Oct 2025Nothing published for this version
-
4.0.101 Oct 2025Release notes
Open source →- You can now run
dart fix --applyto automatically renameScreenshotApp.childtoScreenshotApp.home.
- You can now run
-
4.0.029 Sep 2025Release notes
Open source →- FEAT:
ScreenshotAppnow takes any parameter thatMaterialApptakes. - BREAKING TWEAK:
ScreenshotAppnow takes ahomeparameter instead of achildparameter. This is to be consistent withMaterialApp. - BREAKING TWEAK:
ScreenshotAppnow extendsMaterialAppso if you were usingfind.bySubtype<MaterialApp>()before, you should now usefind.byType(MaterialApp).
- FEAT:
-
3.3.031 May 2025Release notes
Open source →- If you encounter a font falling back to Ahem, please use
await tester.loadFonts(overriddenFonts: ['MYFONT', ...kOverriddenFonts]); - Removed dependency on the deprecated
golden_toolkitpackage
- If you encounter a font falling back to Ahem, please use
-
3.2.112 May 2025Release notes
Open source →- Golden screenshots now support all standard font weights, instead of just normal and bold (see #8).
-
3.2.020 Feb 2025Release notes
Open source →- You can now use
testGoldens(...)instead oftestWidgets(...)to automatically enable shadows, instead of manually setting and unsettingdebugDisableShadows.
- You can now use
-
3.1.412 Feb 2025Release notes
Open source →- Fixed a compilation error when running
flutter test --platform chromeon Flutter 3.29
- Fixed a compilation error when running
-
3.1.331 Dec 2024 -
3.1.231 Dec 2024 -
3.1.131 Dec 2024 -
3.1.031 Dec 2024 withdrawnRelease notes
Open source →- iOS top bar sizes now match exactly with the real devices.
- Switched newerIphone to the iPhone 16 Pro Max.
-
3.0.229 Dec 2024Release notes
Open source →- Frame colors are now guessed based on the current theme's surface color. This will hopefully be more reliable than the previous
SystemChromebased implementation.
- Frame colors are now guessed based on the current theme's surface color. This will hopefully be more reliable than the previous
-
3.0.125 Dec 2024Release notes
Open source →- Added
ScreenshotFrameColors.darkandScreenshotFrameColors.lightnamed constants for convenience.
- Added
-
3.0.023 Dec 2024Release notes
Open source →- The top and bottom bar colors are now decided by Flutter. In most cases, this is sufficient, but you can still override the foreground brightness with by passing a
ScreenshotFrameColorsobject toScreenshotApp.
- The top and bottom bar colors are now decided by Flutter. In most cases, this is sufficient, but you can still override the foreground brightness with by passing a
-
2.3.023 Dec 2024Release notes
Open source →- Added localization arguments to
ScreenshotApp, thanks to @albemala - Renamed
tester.useScreenshotComparatortotester.useFuzzyComparator
- Added localization arguments to
-
2.2.205 Dec 2024Release notes
Open source →- Fixed regression from 2.2.1 where the wrong comparator would be used on io (non-web).
-
2.2.117 Nov 2024Release notes
Open source →- Fixed compilation issues with
flutter test --platform chrome. However, image/font precaching and fuzzy comparison aren't implemented (yet).
- Fixed compilation issues with
-
2.2.017 Nov 2024Release notes
Open source →- You can now use
tester.useScreenshotComparator(Update: renamed totester.useFuzzyComparator) without having to usetester.expectScreenshot. - Added a missing
widgetTypeoption inprecacheImagesInWidgetTreeto allow use withoutScreenshotApp.
- You can now use
-
2.1.012 Sep 2024 -
2.0.110 Aug 2024 -
2.0.010 Aug 2024Release notes
Open source →- Added the ability to use your own set of devices by creating an enum that stores
ScreenshotDeviceobjects. See the README for more. - Added the ability to customize where the goldens are stored by setting
ScreenshotDevice.screenshotsFolder. See the README for more. - Added the ability to use multiple locales by passing a locale code to
tester.expectScreenshot. - Because of the above, you'll need to make the following changes (see the example for more):
# OLD for (final device in ScreenshotDevice.values) { testWidgets('for ${device.name}', (tester) async { # NEW for (final goldenDevice in GoldenScreenshotDevices.values) { testWidgets('for ${goldenDevice.name}', (tester) async { final device = goldenDevice.device;# OLD await tester.expectScreenshot(matchesGoldenFile( '${device.goldenFolder}$goldenFileName.png', )); # NEW await tester.expectScreenshot(device, goldenFileName);
- Added the ability to use your own set of devices by creating an enum that stores
-
1.5.010 Aug 2024Release notes
Open source →- Made the Linux screenshots 16:9 so they can also be used for the Play Store.
-
1.4.010 Aug 2024Nothing published for this version
-
1.3.010 Aug 2024Nothing published for this version
-
1.2.009 Aug 2024Release notes
Open source →- Added a fuzzy comparator to allow for 0.1% difference between a widget's expected and actual image. You should replace the usual
expectLaterwithtester.expectScreenshot(matchesGoldenFile(...))to use this feature.
- Added a fuzzy comparator to allow for 0.1% difference between a widget's expected and actual image. You should replace the usual
-
1.1.009 Aug 2024Release notes
Open source →- You can now run
tester.precacheImagesInWidgetTree()to precache all images currently in the widget tree, instead of having to manually specify each image withtester.precacheImages([...])
- You can now run
-
1.0.209 Aug 2024Release notes
Open source →- Fixed apps that use
MediaQuery.sizenot receiving the simulated screen size
- Fixed apps that use
-
1.0.109 Aug 2024 -
1.0.009 Aug 2024