NvGolden class

The central class of our golden testing framework. It provides a small but powerful interface for golden tests.

Constructors

NvGolden.devices({required List<Screen> deviceSizes, BoxDecoration? decoration, Widget wrap(Widget child)?, Widget wrapScenario(Widget child)?})
Constructor for device tests
NvGolden.grid({required int nrColumns, Screen? screen, Widget wrap(Widget child)?, Widget wrapScenario(Widget child)?, BoxDecoration? decoration})
Constructor for widget tests

Properties

decoration BoxDecoration?
final
hashCode int
The hash code for this object.
no setterinherited
nrColumns int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
Calculate the size for the whole golden file
no setter
widget Widget
no setter
wrap → (Widget Function(Widget child)?)
final
wrapScenario → (Widget Function(Widget child)?)
final

Methods

addScenario({required String name, required Widget widget, Screen? screen}) → void
Add a golden test scenario
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

Static Methods

init() Future<void>
Initialize golden tests
loadFont({required String name, required List<String> paths, bool isRelativePath = true}) Future<void>
Optionally load fonts