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

Expose scale of CachedNetworkImageProvider on CachedNetworkImage #576

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

amake
Copy link

@amake amake commented Mar 21, 2021

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

This PR exposes the scale argument of CachedNetworkImageProvider in the CachedNetworkImage constructor.

⤵️ What is the current behavior?

Currently you cannot set the scale used by the implicitly instantiated CachedNetworkImageProvider, so if you need to set the image scale then you have to use something like Image(image: CachedNetworkImageProvider(url)) so you can't take advantage of the various nice features of CachedNetworkImage.

🆕 What is the new behavior (if this is a feature change)?

Now you can pass the scale argument.

💥 Does this PR introduce a breaking change?

No. The argument has the same default as CachedNetworkImageProvider so the behavior is unchanged if not supplied.

🐛 Recommendations for testing

Try supplying different values of scale to CachedNetworkImage and ensure they take effect.

📝 Links to relevant issues/docs

#572

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

@amake
Copy link
Author

amake commented Mar 30, 2021

It looks like the CI failure is not related to my changes:

Found "Xcode 11.1, Build version 11A1027". Xcode 12.0.1 or greater is required to develop for iOS.

@amake
Copy link
Author

amake commented Sep 3, 2021

I've resolved the conflicts.

@GZaccaroni
Copy link

Please merge this PR, really useful!

@bounty1342
Copy link

One use case could be to use it with a seamless image pattern and repeat option, in order to scale the pattern.
https://www.designer.io/en/tutorials/graphic-design/how-to-design-seamless-pattern/

@alexislg2
Copy link

Any plan to merge this?
I don't understand how are we supposed to deal with images too small if we want them to be displayed full screen.

@amake
Copy link
Author

amake commented Sep 25, 2023

I've resolved the conflicts again.

@amake
Copy link
Author

amake commented Oct 12, 2023

This test failure appears to be spurious.

@alexislg2
Copy link

If you don't plan to merge this PR, could you at least tell why and close it?

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

4 participants