thesmythgroup / easy_image_viewer

An easy Flutter image viewer with pinch & zoom support.
MIT License
41 stars 51 forks source link

GH #34: Initial work to add loading indicator #37

Closed jfahrenkrug closed 11 months ago

jfahrenkrug commented 1 year ago

This adds support for customizing the Image widget that is being displayed. That includes customizing Image's frameBuilder and loadingBuilder. Rather than providing those callbacks as parameters, it's more versatile to let the user create their own Image widget using their desired configuration.

This is now supported in EasyImageProvider through a new imageWidgetBuilder method. The default implementation shows a loading indicator and does a quick fade-in animation once the image is loaded.

However, it's also possible to just customize the widget that is displayed during loading (a CircularProgressIndicator by default).

By using your own EasyImageProvider subclass this can be fully customized.

Checklist

Please ensure your pull request fulfills the following requirements:

Type

What kind of change does this pull request introduce?

[ ] Bug fix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other (please describe below)

Breaking Changes

Does this pull request introduce any breaking changes?

[ ] Yes
[X] No

Other Information

n/a

jimjenkins5 commented 11 months ago

LGTM. Thanks @jfahrenkrug!