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

Allow cover image to be loaded from network instead of local asset #7

Closed
stehag opened this issue Nov 25, 2019 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@stehag
Copy link

stehag commented Nov 25, 2019

Can imagePath be changed from String to Image so we can load the cover image from network instead
of a local asset?

@vintage vintage added the enhancement New feature or request label Nov 25, 2019
@vintage
Copy link
Owner

vintage commented Nov 25, 2019

Hey @stehag!

That should be definitely possible to implement it that way so both local and network image can be used as the cover. Need to dig a bit on how to solve the issue of getting list of bytes from external source, or how to universally get bytes from Image object.

@vintage vintage self-assigned this Nov 25, 2019
@vintage
Copy link
Owner

vintage commented Dec 11, 2019

Kapture 2019-12-11 at 21 02 09

That's the demo which uses image from network https://images.unsplash.com/photo-1571339617057-6761e8428fe0?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80 so it's implementable. I've got some dirty solution locally, need to put some time into polishing it, but it would happen this year 👍

@vintage
Copy link
Owner

vintage commented Dec 14, 2019

Good news @stehag - the feature has landed in 1.3.0 release https://pub.dev/packages/scratcher :) From now on instead of providing imagePath as string, the consumer needs to pass the image parameter which would be typical Flutter image like:

Scratcher(
  image: Image.network("MY_URL"),
  # image: Image.asset("LOCAL_PATH"),
),

That's a breaking change in the API, so the minor version been bumped. Let me know if got any issues 💙

@vintage vintage closed this as completed Dec 14, 2019
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

2 participants