Flutter Text automatic line wrapping

In Flutter, you can use Textthe component to display text. By default, Textcomponents will wrap text whenever the text content exceeds the width of its container.

You can use Textthe component's softWrapprop to control whether the text wraps automatically. If set softWrapto true(the default), the text will automatically wrap; if set softWrapto false, the text will not automatically wrap, but will exceed the boundaries of its container.

TextFor example, the following code creates a component that does not wrap :

Text(
  '这是一行长文本,它不会自动换行。',
  softWrap: false,
),

Guess you like

Origin blog.csdn.net/weixin_42600128/article/details/129450896