hasEffectiveMaxLinesWhere method

WidgetMatcher<Text> hasEffectiveMaxLinesWhere(
  1. MatchProp<int> match
)

A WidgetMatcher for Text widgets that performs specific assertions by applying a custom matcher function to the maxLines property.

Example:

spot<Text>().withText('foo').existsOnce()
  .hasEffectiveMaxLinesWhere((it) => it.isNotNull().isGreaterThan(1));

See also:

Implementation

WidgetMatcher<Text> hasEffectiveMaxLinesWhere(MatchProp<int> match) {
  return hasProp(
    elementSelector: (subject) => subject.context.nest<int?>(
      () => ['has "maxLines"'],
      (Element element) => Extracted.value(_extractMaxLines(element)),
    ),
    match: match.hideNullability(),
  );
}