createParagraph function
Creates a Paragraph object using the specified text, style, and
foregroundOverride.
Implementation
Paragraph createParagraph(
String text,
DrawableStyle style,
DrawablePaint? foregroundOverride,
) {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle())
..pushStyle(
style.textStyle!.toFlutterTextStyle(
foregroundOverride: foregroundOverride,
),
)
..addText(text);
return builder.build()..layout(_infiniteParagraphConstraints);
}