spotOffstage function

  1. @useResult
WidgetSelector<Widget> spotOffstage({
  1. List<WidgetSelector<Widget>> parents = const [],
  2. List<WidgetSelector<Widget>> children = const [],
})

Creates a WidgetSelector that includes only offstage widgets in the selection.

Offstage widgets are those that are not currently visible on the screen, but are still part of the widget tree. This can be useful when you want to select and perform operations on widgets that are not currently visible to the user.

Returns a new WidgetSelector that includes offstage widgets.

Example usage:

final text = spotOffstage()
  .spotText('text');

Implementation

@useResult
WidgetSelector<Widget> spotOffstage({
  List<WidgetSelector> parents = const [],
  List<WidgetSelector> children = const [],
}) {
  return WidgetSelector(
    stages: [
      PredicateFilter(
        predicate: (e) => true,
        description: 'any Offstage Widget',
      ),
    ],
    widgetPresence: WidgetPresence.offstage,
  );
}