PlatformGoldensConfig class

{@template platform_goldens_config} The configuration for human readable golden tests.

This contains various settings used by goldenTest to determine whether and how to run golden tests intended to be run locally.

By default, the golden file is located in the goldens/<platform_name> directory relative to the test file.

By default, renderShadows is set to true so platform golden images are a more accurate representation of the tested widget.

{@endtemplate platform_goldens_config}

Inheritance

Constructors

PlatformGoldensConfig({Set<HostPlatform>? platforms, bool enabled = true, bool obscureText = false, bool renderShadows = true, FilePathResolver? filePathResolver, ThemeData? theme})
const

Properties

enabled bool
Whether or not the golden tests should run.
finalinherited
environmentName String
A name for the environment in which this test is run
no setteroverride
filePathResolver FilePathResolver
A function that returns the path of the golden file for a given test's file name. This function's return value should include the .png extension.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
obscureText bool
Whether or not all text should be rendered as colored boxes
finalinherited
platforms Set<HostPlatform>
The set of HostPlatforms that platform golden tests will run on.
no setter
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setteroverride
renderShadows bool
Whether shadows should be rendered normally or as solid color blocks.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
theme ThemeData?
The ThemeData to use when generating golden tests.
no setterinherited

Methods

copyWith({Set<HostPlatform>? platforms, bool? enabled, bool? obscureText, bool? renderShadows, FilePathResolver? filePathResolver, ThemeData? theme}) PlatformGoldensConfig
Creates a copy of this GoldensConfig and replaces the given fields.
override
merge(covariant PlatformGoldensConfig? other) PlatformGoldensConfig
Creates a copy and merges this GoldensConfig with the given config, replacing all set fields of the copy with the given config's fields.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited