hasEffectiveTextStyle method

WidgetMatcher<Text> hasEffectiveTextStyle(
  1. TextStyle? value
)

A WidgetMatcher for Text widgets that performs a singular assertion against a fixed TextStyle value.

Example:

final style = TextStyle(
  fontSize: 20,
  fontStyle: FontStyle.italic,
  fontWeight: FontWeight.bold,
  letterSpacing: 2,
);
spot<Text>().withText('foo').existsOnce().hasEffectiveTextStyle(style);

See also:

Implementation

WidgetMatcher<Text> hasEffectiveTextStyle(TextStyle? value) {
  return hasEffectiveTextStyleWhere((it) {
    if (value == null) {
      it.isNull();
    } else {
      it.equals(value);
    }
  });
}