在 Dart 中创建换行符

Luc*_*ack 4 html javascript dart

我需要在一个以 HTML 格式输出的字符串中中断;

String str = "Hello <br /> There"; 
Run Code Online (Sandbox Code Playgroud)

会输出:

Hello 
There
Run Code Online (Sandbox Code Playgroud)

Ton*_*nio 7

尝试

String str = "Hello\nThere";
Run Code Online (Sandbox Code Playgroud)

反而。

不过,可能需要将white-space: prewhite-space: pre-wrap应用于显示文本的元素的样式。