withIcon method

  1. @useResult
WidgetSelector<IconButton> withIcon(
  1. Widget? value
)

Creates a WidgetSelector that finds all IconButton where icon equals (==) value.

Example usage:

spot<IconButton>().withIcon(Container()).existsOnce();

Implementation

@useResult
WidgetSelector<IconButton> withIcon(Widget? value) {
  return withDiagnosticProp<Widget>(
      'icon', (it) => value == null ? it.isNull() : it.equals(value));
}