getParagraph method
- String text
Returns a ui.Paragraph object for the given text.
Implementation
ui.Paragraph getParagraph(String text) {
if (text.length == 1) text = "0$text";
ui.ParagraphBuilder builder = ui.ParagraphBuilder(
ui.ParagraphStyle(fontSize: 10.0, textAlign: TextAlign.right))
..pushStyle(ui.TextStyle(color: Colors.black))
..addText(text);
final ui.Paragraph paragraph = builder.build()
..layout(const ui.ParagraphConstraints(width: 20));
return paragraph;
}