withEffectiveTextStyle method

WidgetSelector<Text> withEffectiveTextStyle(
  1. TextStyle? value
)

A WidgetSelector for Text widgets widgets that have a fixed TextStyle value.

Example:

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

See also:

Implementation

WidgetSelector<Text> withEffectiveTextStyle(TextStyle? value) {
  return withEffectiveTextStyleMatching((it) {
    if (value == null) {
      it.isNull();
    } else {
      it.equals(value);
    }
  });
}