0

There are several classes and methods in Flutter that have "Paragraph" in the name. Examples:

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:

Paragraph class

A paragraph of text.

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393

2 Answers2

0

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.';

See here and here.

See also

Community
  • 1
  • 1
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
0

You should use Expanded instead, and when you want to create new paragraph, add these lines of codes:

final text = "Paragraph one \n\n Paragraph two \n\n Paragraph three";
Wege
  • 177
  • 2
  • 11