spotSingle<W extends Widget> function
- @useResult
- @Deprecated('Use spot<W>().atMost(1)')
- List<
WidgetSelector< parents = const [],Widget> > - List<
WidgetSelector< children = const [],Widget> >
Creates a chainable WidgetSelector that matches a single Widget of
type W
.
When executed this WidgetSelector will fail when it finds multiple
Widgets of type W
in widget tree.
This selector compares the Widgets by runtimeType rather than by super
type (see WidgetTypeFilter). This makes sure that e.g. spotSingle<Align>()
does not accidentally match a Center Widget, that extends Align.
If multiple Widgets of type W
are expected, use spot instead.
Implementation
@useResult
@Deprecated('Use spot<W>().atMost(1)')
WidgetSelector<W> spotSingle<W extends Widget>({
List<WidgetSelector> parents = const [],
List<WidgetSelector> children = const [],
}) {
return _global.spotSingle<W>(
parents: parents,
children: children,
);
}