hasIcon method

WidgetMatcher<IconButton> hasIcon(
  1. Widget? value
)

Expects that icon of IconButton equals (==) value.

Example usage:

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

Implementation

WidgetMatcher<IconButton> hasIcon(Widget? value) {
  return hasDiagnosticProp<Widget>(
      'icon', (it) => value == null ? it.isNull() : it.equals(value));
}