Remove Flutter HTML widget's default padding

Issue

There is a default padding in flutter_html already when trying to parse text.

Below is the difference between using HTML(data: ...) and Text(...) widgets.

Top: HTML Widget, Bottom: Text Widget
Screenshot Reference

How can I remove the horizontal padding?

Solution

I think HTML or body is having a default padding and/or margin.

Try adding "body": Style(margin: EdgeInsets.zero, padding: EdgeInsets.zero, in the style parameter.

Answered By – Sahil Sonawane

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *