getTextPainterLaidout function
TextPainter
getTextPainterLaidout({
- required BuildContext context,
- required String text,
- TextStyle? style,
- TextScaler? textScaler,
Implementation
TextPainter getTextPainterLaidout({
required BuildContext context,
required String text,
TextStyle? style,
TextScaler? textScaler,
}) {
textScaler ??= TextScaler.linear(
View.of(context).platformDispatcher.textScaleFactor,
);
final TextPainter textPainter = TextPainter(
text: TextSpan(text: text, style: style),
textDirection: TextDirection.ltr,
textScaler: textScaler,
);
textPainter.layout();
return textPainter;
}