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

[Feature request] Add loading indicator while image is being loaded #34

Closed
sunenvidiado-nx opened this issue Jun 15, 2023 · 8 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@sunenvidiado-nx
Copy link

Describe the Feature

Add a loading indicator or spinner widget while the image is being loaded.

Suggested Solution

Maybe a loadingIndicator property can be added that accepts a Widget. This way, while the image is loading, a custom spinner widget of our choice is displayed. I think it would be awesome to have this option added.

Other Information

n/a

@RemonYounan
Copy link

+1 for this feature request!

Adding a loading indicator or spinner widget while the image is being loaded would greatly improve the user experience. I think it would be awesome to have a loadingIndicator property that accepts a Widget. This way, developers can easily customize the spinner widget according to their design preferences.

Please consider implementing this feature as it would be a valuable addition to the package and benefit the Flutter community.

Thank you!

@jfahrenkrug
Copy link
Collaborator

Thank you, that sounds like a great addition. I'll try to find time for this soon.

@jfahrenkrug jfahrenkrug self-assigned this Jul 10, 2023
@jfahrenkrug jfahrenkrug added the enhancement New feature or request label Jul 10, 2023
jfahrenkrug added a commit that referenced this issue Jul 13, 2023
This adds initial 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.

By using your own EasyImageProvider subclass this can be fully customized. Some tests
still fail and more tests need to be added, but this is a first shot at this.
@jfahrenkrug
Copy link
Collaborator

jfahrenkrug commented Jul 13, 2023

@RemonYounan @amazing-sun You can find an initial implementation here: #37 Let me know what you think of this approach. Thanks!

@jfahrenkrug
Copy link
Collaborator

jfahrenkrug commented Aug 10, 2023

@RemonYounan @amazing-sun Did you have a chance to try out #37?

@sunenvidiado-nx
Copy link
Author

Hello @jfahrenkrug, I've had a busy few days, but I'll definitely take a look at it when I have some free time over the weekend 🤠

@sunenvidiado-nx
Copy link
Author

Hey @jfahrenkrug, I just checked it and using an image provider instead of a widget as an argument is a good idea. But I noticed that the loading widget doesn't appear right away.

@jfahrenkrug
Copy link
Collaborator

@amazing-sun Thank you very much for checking. Are you able to upload a video or gif of what you are seeing and adding some details of what your code looks like exactly? Thanks!

jfahrenkrug added a commit that referenced this issue Dec 11, 2023
This adds initial 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.

By using your own EasyImageProvider subclass this can be fully customized. Some tests
still fail and more tests need to be added, but this is a first shot at this.
jimjenkins5 added a commit that referenced this issue Dec 13, 2023
GH #34: Initial work to add loading indicator
@jfahrenkrug
Copy link
Collaborator

This issue is closed by this PR: #37

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

No branches or pull requests

3 participants