withBackground method

  1. @useResult
WidgetSelector<Container> withBackground(
  1. Decoration? value
)

Creates a WidgetSelector that finds all Container where background equals (==) value.

Example usage:

spot<Container>().withBackground(BoxDecoration(color: Colors.blue)).existsOnce();

Implementation

@useResult
WidgetSelector<Container> withBackground(Decoration? value) {
  return withDiagnosticProp<Decoration>(
      'bg', (it) => value == null ? it.isNull() : it.equals(value));
}