flutterdartmarkdown

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.


Solution

  • I've found a nasty trick (not a solution) that may be of help in this specific case. I don't recommend it, but couldn't find any other workaround using flutter_markdown so far, and I couldn't find any other package in substitution neither.

    Checkout the image

    You can take advantage of using triple apostrophes to add vertical space.

    It is a nasty workaround, but couldn't find anything better so far to add vertical space.