flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

Expose `scale` of CachedNetworkImageProvider on CachedNetworkImage

Open amake opened this issue 3 years ago • 8 comments

:sparkles: 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.

:arrow_heading_down: 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.

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

Now you can pass the scale argument.

:boom: Does this PR introduce a breaking change?

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

:bug: Recommendations for testing

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

:memo: Links to relevant issues/docs

#572

:thinking: Checklist before submitting

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

amake avatar Mar 21 '21 14:03 amake

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 avatar Mar 30 '21 07:03 amake

I've resolved the conflicts.

amake avatar Sep 03 '21 11:09 amake

Please merge this PR, really useful!

GZaccaroni avatar Sep 26 '21 20:09 GZaccaroni

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/

bounty1342 avatar Nov 11 '21 01:11 bounty1342

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.

alexislg2 avatar Dec 06 '21 15:12 alexislg2

I've resolved the conflicts again.

amake avatar Sep 25 '23 22:09 amake

This test failure appears to be spurious.

amake avatar Oct 12 '23 10:10 amake

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

alexislg2 avatar Dec 13 '23 06:12 alexislg2