WidgetTreeOptions constructor

const WidgetTreeOptions({
  1. Finder findWidget(
    1. WidgetTester,
    2. Widget
    )?,
  2. String goldenPath = 'test/golden_widget_trees',
  3. String failurePath = 'test/failures/golden_widget_trees',
  4. String? goldenName,
  5. Set strippedWidgets = defaultIgnoredWidgets,
  6. bool stripPrivateWidgets = true,
  7. IncludeWidgetBounds includeWidgetBounds = IncludeWidgetBounds.relative,
  8. 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,
});