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

[Discussions] Cache image in Android #593

Closed
duymanhit opened this issue Jun 28, 2023 · 3 comments
Closed

[Discussions] Cache image in Android #593

duymanhit opened this issue Jun 28, 2023 · 3 comments
Assignees

Comments

@duymanhit
Copy link

Content

I cannot enable the cache of network images in Android. When the cache is set to True, the image will be an error because it did not find the local cache file

@duymanhit duymanhit changed the title [Discussions] [Discussions] Cache image in Android Jun 28, 2023
@zmtzawqlp
Copy link
Member

any error log or a runnable simple demo?

@duymanhit
Copy link
Author

duymanhit commented Jun 29, 2023

Hello @zmtzawqlp,
This is my code:

      Network().getFile(
        url,
        thumbnail: thumbnail,
        isProfile: isProfile,
      ),
      cache: true,
      cacheMaxAge: const Duration(minutes: 5),
      cacheKey: url,
      loadStateChanged: loadStateChanged ?? defaultLoadStateChanged,
      constraints: constraints,
      fit: boxFit,
      shape: shape,
      borderRadius: borderRadius,
      clipBehavior: Clip.antiAliasWithSaveLayer,
      border: border,
      // cache: false,
    );

And error logs:

__I/flutter ( 9866): PathNotFoundException: Cannot open file, path = '/data/user/0/com.example.vifa_client/cache/cacheimage/u/89/9734efaa-8595-56ff-b26b-10765d79fa24.jpg' (OS Error: No such file or directory, errno = 2)
I/flutter ( 9866): Bad state: Cannot add event after closing

@zmtzawqlp
Copy link
Member

please provide more info about this issue, i can't reproduce it at my side

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

No branches or pull requests

2 participants