createText static method

TextPainter createText(
  1. String text,
  2. TextStyle style
)

Implementation

static TextPainter createText(String text, TextStyle style) {
  TextPainter painter = TextPainter()
    ..text = TextSpan(text: text, style: style)
    ..textDirection = TextDirection.ltr
    ..layout();
  return painter;
}