A Flutter Best Practice Google Is Hiding, Better Skia Goldens Testing

Fred Grott
3 min readDec 10, 2021

he default Skia Goldens testing leaves a lot to be desired in that the only fonts that are loaded is a very skimpy font to show blocks, no way to show all the device forms, and a cumbersome way to inject the root widget above the widget under test.

There is a better practice way to implement Skia Goldens testing, so we get all those problems addressed and cool tool for acceptance testing.

What I am Using

The Dynamic Platform Widgets plugin I am using is:

It dynamically delivers the right widgets to the right platform instead of wiring all that stuff by-hand.

To supply custom fonts for Goldens testing, I go beyond just using the Google Fonts Flutter package:

I download the fonts I want to use and stick them in the google-fonts subfolder in my Flutter App project folder and declare that assets folder in my pubspec.

The to complete the SKIA Goldens better testing toolkit I use eBay’s Golden Toolkit:

Implementing Better Skia Goldens Testing

It’s called Skia Goldens Testing, as it uses the Skia render part of the Flutter Embed Sky engine to render a few frames of the widget.

With using eBay’s Golden Toolkit we get way more cool stuff to use in Goldens acceptance testing.