TextPainter constructor
Creates a text painter that paints the given text.
The text
and textDirection
arguments are optional but text
and
textDirection
must be non-null before calling layout.
The textAlign
property must not be null.
The maxLines
property, if non-null, must be greater than zero.
Implementation
TextPainter({
TextSpan text,
TextAlign textAlign = TextAlign.start,
TextDirection textDirection,
double textScaleFactor = 1.0,
int maxLines,
String ellipsis,
Locale locale,
}) : assert(text == null || text.debugAssertIsValid()),
assert(textAlign != null),
assert(textScaleFactor != null),
assert(maxLines == null || maxLines > 0),
_text = text,
_textAlign = textAlign,
_textDirection = textDirection,
_textScaleFactor = textScaleFactor,
_maxLines = maxLines,
_ellipsis = ellipsis,
_locale = locale;