withStyle method

Creates a WidgetSelector that finds all ElevatedButton where style equals (==) value.

Example usage:

spot<ElevatedButton>().withStyle(ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.blue))).existsOnce();

Implementation

@useResult
WidgetSelector<ElevatedButton> withStyle(ButtonStyle? value) {
  return withDiagnosticProp<ButtonStyle>(
      'style', (it) => value == null ? it.isNull() : it.equals(value));
}