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

✨ Add http cache support. #33

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

iota9star
Copy link
Member

@iota9star iota9star commented Jul 22, 2021

  1. Add http cache support.
  2. Remove cacheMaxAge field from ExtendedNetworkImageProvider.
  3. Change base cache dir.

Comment on lines +189 to +190
final Directory dir = Directory(
join((await getTemporaryDirectory()).path, cacheImageFolderName));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final Directory dir = Directory(
join((await getTemporaryDirectory()).path, cacheImageFolderName));
final Directory dir = Directory(
join((await getTemporaryDirectory()).path, cacheImageFolderName),
);

final Directory dir = Directory(
join((await getTemporaryDirectory()).path, cacheImageFolderName));
// ignore: avoid_slow_async_io
if (!await dir.exists()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the synchronized method?

Suggested change
if (!await dir.exists()) {
if (!dir.existsSync()) {

} else {
final File lockFile = _childFile(parentDir, '$rawFileName.lock');
// ignore: avoid_slow_async_io
final bool exist = await lockFile.exists();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final bool exist = await lockFile.exists();
final bool exist =lockFile.existsSync();

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.

2 participants