WidgetTreeOptions constructor
const
WidgetTreeOptions({
- Finder findWidget()?,
- String goldenPath = 'test/golden_widget_trees',
- String failurePath = 'test/failures/golden_widget_trees',
- String? goldenName,
- Set strippedWidgets = defaultIgnoredWidgets,
- bool stripPrivateWidgets = true,
- IncludeWidgetBounds includeWidgetBounds = IncludeWidgetBounds.relative,
- int boundsPrecision = 0,
Implementation
const WidgetTreeOptions({
/// A function to find the widget to create the tree for. If not provided,
/// the widget passed to [widgetTreeMatchesGolden] will be used.
this.findWidget,
/// The path to the golden directory. If not provided,
/// 'test/golden_widget_trees' will be used.
this.goldenPath = 'test/golden_widget_trees',
/// The path to the failure directory. If not provided,
/// 'test/failures/golden_widget_trees' will be used.
this.failurePath = 'test/failures/golden_widget_trees',
/// The name of the golden file to compare with. If not provided, the name
/// of the widget will be used.
this.goldenName,
/// A set of widgets to strip from the tree (in order to produce a less
/// verbose tree). If not provided, a default set of widgets will be
/// used, cf. [defaultIgnoredWidgets].
this.strippedWidgets = defaultIgnoredWidgets,
/// Whether to strip away private widgets (i.e. widgets starting with '_').
/// Defaults to true.
this.stripPrivateWidgets = true,
/// Whether to include the bounds of the widgets in the tree. If set to
/// [IncludeWidgetBounds.relative], the bounds will be relative to the
/// parent widget. If set to [IncludeWidgetBounds.absolute], the bounds
/// will be absolute on the screen. If set to [IncludeWidgetBounds.none],
/// the bounds will not be included.
this.includeWidgetBounds = IncludeWidgetBounds.relative,
/// The precision of the bounds to include in the tree, e.g. 2 for
/// 2 decimal places. Defaults to 0.
this.boundsPrecision = 0,
});