withEffectiveMaxLinesMatching method
A WidgetSelector for Text widgets that meet specified maxLines
conditions, as defined by a custom matcher function.
Example:
spot<Text>().withEffectiveMaxLinesMatching(
(it) => it.isNotNull().isGreaterThan(1)).existsOnce();
See also:
- withEffectiveMaxLines, for selecting Text widgets that have a fixed
maxLines
value.
Implementation
WidgetSelector<Text> withEffectiveMaxLinesMatching(MatchProp<int?> match) {
return withProp(
elementSelector: (subject) => subject.context.nest<int?>(
() => ['with "maxLines"'],
(Element element) => Extracted.value(_extractMaxLines(element)),
),
match: match,
);
}