spot<W extends Widget> function
WidgetSelector<W>
spot<W extends Widget>({
- List<
WidgetSelector< parents = const [],Widget> > - List<
WidgetSelector< children = const [],Widget> >
Creates a chainable WidgetSelector that matches a all Widgets of
type W
in widget tree.
spot<SomeWidget>()
is the most common way to chain selectors.
This selector compares the Widgets by runtimeType rather than by super
type (see WidgetTypeFilter). This makes sure that e.g. spot<Align>()
does not accidentally match a Center Widget, that extends Align.
spot ignores Offstage widgets.
To find offstage widgets, use spotOffstage().spot<MyWidget>()
.
See spotOffstage and spotAllWidgets
Implementation
@useResult
WidgetSelector<W> spot<W extends Widget>({
List<WidgetSelector> parents = const [],
List<WidgetSelector> children = const [],
}) {
return _global.spot<W>(
parents: parents,
children: children,
);
}