generateParagraph static method
dynamic
generateParagraph(
- DanmakuContentItem content,
- double danmakuWidth,
- double fontSize,
- int fontWeight,
Implementation
static generateParagraph(DanmakuContentItem content, double danmakuWidth,
double fontSize, int fontWeight) {
final ui.ParagraphBuilder builder = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.left,
fontSize: fontSize,
fontWeight: FontWeight.values[fontWeight],
textDirection: TextDirection.ltr,
))
..pushStyle(ui.TextStyle(
color: content.color,
))
..addText(content.text);
return builder.build()
..layout(ui.ParagraphConstraints(width: danmakuWidth));
}