MongolTextPainter constructor
MongolTextPainter({
- TextSpan? text,
- MongolTextAlign textAlign = MongolTextAlign.top,
- @Deprecated('Use textScaler instead. ' 'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. ' 'This feature was deprecated after v3.12.0-2.0.pre.') double textScaleFactor = 1.0,
- TextScaler textScaler = TextScaler.noScaling,
- int? maxLines,
- String? ellipsis,
- TextHeightBasis textHeightBasis = TextHeightBasis.parent,
Creates a text painter that paints the given text.
The text
argument is optional but text
must be non-null before
calling layout.
The maxLines
property, if non-null, must be greater than zero.
Implementation
MongolTextPainter({
TextSpan? text,
MongolTextAlign textAlign = MongolTextAlign.top,
@Deprecated(
'Use textScaler instead. '
'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. '
'This feature was deprecated after v3.12.0-2.0.pre.',
)
double textScaleFactor = 1.0,
TextScaler textScaler = TextScaler.noScaling,
int? maxLines,
String? ellipsis,
TextHeightBasis textHeightBasis = TextHeightBasis.parent,
}) : assert(text == null || text.debugAssertIsValid()),
assert(maxLines == null || maxLines > 0),
assert(
textScaleFactor == 1.0 ||
identical(textScaler, TextScaler.noScaling),
'Use textScaler instead.'),
_text = text,
_textAlign = textAlign,
_textScaler = textScaler == TextScaler.noScaling
? TextScaler.linear(textScaleFactor)
: textScaler,
_maxLines = maxLines,
_ellipsis = ellipsis,
_textHeightBasis = textHeightBasis;