Flutter类中段落的含义 [英] Meaning of Paragraph in Flutter classes
问题描述
Flutter中有几个类和方法的名称带有"Paragraph".例子:
There are several classes and methods in Flutter that have "Paragraph" in the name. Examples:
- Paragraph
- ParagraphBuilder
- RenderParagraph
- ParagraphStyle
- Canvas.drawParagraph
这里的段落是什么意思?通常,我认为一段文本是一些没有换行符的句子. Flutter段落可以包含多行吗?
What is the meaning of paragraph here? Usually I think of a paragraph of text as a few of sentences with no new line characters. Can a Flutter paragraph contain multiple new lines?
文档不清楚:>
The documentation isn't clear:
段落类
一段文字.
推荐答案
Flutter段落可以包含多个换行符.这可以通过在ParagraphBuilder或TextPainter中使用以下文本字符串来演示,该文本字符串会在Flutter的意义上创建单个Paragraph.
A Flutter Paragraph can contain more that one newline character. This can be demonstrated by using the following text string in a ParagraphBuilder or a TextPainter, which creates a single Paragraph in the Flutter sense of the word.
final text = 'My text line.\nThis line is longer than the last.\nAnother line.';
请参见此处和
这篇关于Flutter类中段落的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!