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

Image properties and onImageTap for the richTextParser, plus some fixes #90

Merged
merged 8 commits into from
May 21, 2019
Merged

Conversation

andreyeurope
Copy link

As we have talked, I have added an image properties attribute to the flutter_html library.
More than that, I have previously tried to use the 'alt' HTML element, but was not working.
I have fixed that.
I have also added onImageTap support for the richText parser.

Note: I don't know how you like your project structured, but I usually use a different file for a different class.

Andrei added 3 commits May 18, 2019 01:15
- Added onTap support for Image widgets that are parsed by the richTextParser
- Added ImageProperties to the richTextParser
- Fixed 'alt' HTML element - it was not working before due to the if..else if.. confusion
@andreyeurope
Copy link
Author

@Sub6Resources Please take a look whenever you have time.
I have also other ideas for this library, like adding support for customStyle for headings and body. (I usually use the guidelines from Material Design)

lib/html_parser.dart Outdated Show resolved Hide resolved
lib/html_parser.dart Outdated Show resolved Hide resolved
lib/image_properties.dart Outdated Show resolved Hide resolved
lib/html_parser.dart Outdated Show resolved Hide resolved
@The-Redhat
Copy link
Contributor

The-Redhat commented May 18, 2019

Since your are it. It would be nice if you add showImage as a Parameter. My
use case is to give the user the option to disable image loading without WiFi.

@andreyeurope
Copy link
Author

@The-Redhat When this PR gets merged, you should be able to use the showImages parameter.
It works for both the richText and default parser.

Copy link
Owner

@Sub6Resources Sub6Resources left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

@Sub6Resources Sub6Resources added the enhancement New feature or request label May 21, 2019
@Sub6Resources Sub6Resources merged commit 76c1f77 into Sub6Resources:master May 21, 2019
@w4mxl
Copy link

w4mxl commented May 21, 2019

@andreyeurope @Sub6Resources

Can onImageTap Function consider adding image url or image data as parameters ?

This makes it easy to do some other processing when onTap, such as a large image preview.

Thanks!

@andreyeurope
Copy link
Author

@w4mxl I will create a new PR for it.
I think it would be useful for me as well.
I will add an argument representing the source of the image ( so it will be a string containing the URL, the asset path etc.).

@w4mxl
Copy link

w4mxl commented May 21, 2019

@andreyeurope Sounds good. Thank you!

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

Successfully merging this pull request may close these issues.

None yet

4 participants