Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding ability to disable using width and height attributes in img tag #235

Closed
wants to merge 1 commit into from

Conversation

saeidraei
Copy link

extra parameters added to image properties for letting user choose to use or not to use the width and height attributes in img tag.
the main reason for this change is that the pixels in web is different with flutter. But the html is made for web not for flutter so with this parameter we are able to control this.

I have set the default value for this added parameters to true so that package's behavior won't change. But I personally think that this parameters default value should be false.

… use or not to use the width and height attributes.
@erickok
Copy link
Collaborator

erickok commented Jan 15, 2021

Let's discuss: #497

@tneotia tneotia mentioned this pull request Jan 17, 2021
@tneotia
Copy link
Collaborator

tneotia commented Feb 4, 2021

Hi there, thanks for this PR! It looks like this code applies to the old parser and thus is incompatible with the latest changes on the branch. As a result, we may close this PR.
However, with #505, we have finally added this capability into the library with a custom image rendering API (much better than the current customRender). You can see the discussion at #497 to see how it works. If you have any suggestions, please let @erickok know there. Again thanks for contributing! :)

@erickok
Copy link
Collaborator

erickok commented Feb 8, 2021

With #505 you can now implement custom image rendering. See the README for more details. Generally speaking you can do whatever you like.

If all you want to do is set some custom height or width you can use the helper networkImageRender(width: 100, height: 100) as render. There is no explicit option to opt-out of using the attribute-defined width and height you can either implement your own render or even just remove the width/height attributes from images before feeding the HTML to flutter_html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants