A decent Work Around.
A new feature is added in Flutter_markdown package called paddingBuilders
, from version 0.6.8. you can add padding to all of the blocks available in markdown like below.
MarkdownBody(
data: markDown,
paddingBuilders: <String,
MarkdownPaddingBuilder>{
'p': PPaddingBuilder(),
'h3': H3PaddingBuilder(),
},
)
where you have to define the padding builder like below.
class PPaddingBuilder extends MarkdownPaddingBuilder {
@override
EdgeInsets getPadding() => const EdgeInsets.only(top: SGSpacing.xlarge);
}
class H3PaddingBuilder extends MarkdownPaddingBuilder {
@override
EdgeInsets getPadding() => const EdgeInsets.only(top: SGSpacing.xxlarge);
}
The list of all blockTag
available in Flutter_markdown from source code is below:
const List<String> _kBlockTags = <String>[
'p',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'li',
'blockquote',
'pre',
'ol',
'ul',
'hr',
'table',
'thead',
'tbody',
'tr'
];
PS: padding will not work for inline Tags. only block Tag applicable.
</br>
instead of<br/>
. I'm not sure if that will help – Gault