hasEffectiveMaxLines method
A WidgetMatcher for Text widgets that performs a singular assertion
against a fixed maxLines
value.
Example:
spot<Text>().withText('foo').existsOnce()
.hasEffectiveMaxLines(1);
See also:
- hasEffectiveMaxLinesWhere, a matcher that performs specific assertions
by applying a custom matcher function to the
maxLines
property.
Implementation
WidgetMatcher<Text> hasEffectiveMaxLines(int? value) {
return hasEffectiveMaxLinesWhere((it) {
if (value == null) {
it.isNull();
} else {
it.equals(value);
}
});
}