GoldenBuilder class

GoldenBuilder builds column/grid layout for it's children

Constructors

GoldenBuilder.column({Color? bgColor, WidgetWrapper? wrap})
Will output a .png file with a column layout in 'tests/goldens' folder.
factory
GoldenBuilder.grid({required int columns, required double widthToHeightRatio, WidgetWrapper? wrap, Color? bgColor})
Will output a *.png file with a grid layout in 'tests/goldens' folder.
factory

Properties

bgColor Color?
background bgColor color of output .png file
final
columns int
number of columns columns in a grid
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scenarios List<Widget>
List of tests scenarios being run within GoldenBuilder
final
widthToHeightRatio double
widthToHeightRatio grid layout
final
wrap WidgetWrapper?
Can be used to wrap all scenario widgets. Useful if you wish to provide consistent UI treatment to all of them or need to inject dependencies.
final

Methods

addScenario(String name, Widget widget) → void
addScenario will add a test GoldenBuilder
addScenarioBuilder(String name, Widget fn(BuildContext context)) → void
addScenarioBuilder will add a test with BuildContext GoldenBuilder use as: ..addScenarioBuilder( 'Test with context', (context) { var color = Theme.of(context).colorScheme.primary; return Container(color: color); }, )
addTextScaleScenario(String name, Widget widget, {double textScaleFactor = textScaleFactorMaxSupported}) → void
addTextScaleScenario will add a test to GoldenBuilder where u can provide custom font size
build() Widget
build will build a list of scenarios with a given layout
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