Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter_markdown multiple line breaks not working

I am trying flutter_markdown package to markdown some content. But it is not working properly for multiple line breaks.

 String exampleData="\n\nLine 1. \n\nLine2.\n\n\n\n### Heading \n\nLine3";
 Markdown(data: exampleData,)

The output is enter image description here

I tried with line breaks "<br />" but it didn't worked

 String exampleData="Line 1. \n\nLine2. <br /> <br /> \n\n### Heading \n\nLine3";

Out put is enter image description here

Can someone help me with this line breaks or any alternative packages.

like image 297
BLB Avatar asked Jun 04 '26 04:06

BLB


1 Answers

check out below link!!

enter link description here

br tag is not working, so using 3 back slash + n instead of br tag

String exampleData="Line 1. \\\nLine2. \\\n## Heading \\\nLine3";
like image 164
Taehyung_Kim_93 Avatar answered Jun 06 '26 19:06

Taehyung_Kim_93