loadFonts function

Future<void> loadFonts([
  1. String? package
])

Load fonts to make sure they show up in golden tests.

To use it efficiently:

Note for this function to work, your package needs to include all fonts it uses in a font dir at the root of the project.

Implementation

Future<void> loadFonts([String? package]) async {
  return package != null
      ? loadFontsFromPackage(
          package: Package(name: package, relativePath: './$package'),
        )
      : loadFontsFromPackage();
}