Flutter类中段落的含义 [英] Meaning of Paragraph in Flutter classes

查看:210
本文介绍了Flutter类中段落的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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的Paragraph类的宽度度量?
    • What is the meaning Flutter's width metrics for the Paragraph class?

    这篇关于Flutter类中段落的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆