Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.79k stars 860 forks source link

How to delete margin in child container[QUESTION] #1144

Closed Mullexoll closed 1 year ago

Mullexoll commented 2 years ago

Inside the parser, the container has a margin EdgeInset.all(8). Who knows how to remove it, it causes inconvenience

A picture of a cute animal (not mandatory but encouraged)

Mullexoll commented 2 years ago

Screenshot 2022-09-21 at 17 22 32

erickok commented 2 years ago

Just use a style on the body tag and set the margin to EdgeInsets.zero

Sub6Resources commented 1 year ago

For example, as of the latest version (3.0.0-alpha.5):

Html(
  data: yourHtmlData,
  style: {
    "body": Style(margin: EdgeInsets.zero),
  },
)

The fact that the widget automatically wraps the html in an html and body tag could definitely be better documented!