Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Line Breaks in Dart

I need to get make a break inside a string that will output in HTML;

String str = "Hello <br /> There"; 

would output:

Hello 
There
like image 477
LucaSpeedStack Avatar asked Sep 03 '14 18:09

LucaSpeedStack


1 Answers

Try

String str = "Hello\nThere";

instead.

Might need to apply white-space: pre or white-space: pre-wrap to the style of the element where you're displaying the text, though.

like image 56
Tonio Avatar answered Oct 03 '22 06:10

Tonio