I’m trying to make a html ad widget using html package, but the widget just occupy space, doesn’t display layout.
Widget _adWIdget() {
return Html(data: """
<iframe src=adUrl width="100%" height="44" frameborder="0" scrolling="no" referrerpolicy="unsafe-url"></iframe>
""");
}
I think it’s because I didn’t setup a layout showing, how can I show the html layout?
2
Answers
I solved it, when using iframe, you should use not only html but also the external package html_iframe.(you can install 'flutter pub add flutter_html_iframe')
The external package includes the following.
and you can use the following code.
You will need to use
flutter_html
package to achieve your requirement.Result: