Skip to content

✨ Add http cache support.#33

Open
iota9star wants to merge 9 commits into
fluttercandies:masterfrom
iota9star:feature/support-network-cache
Open

✨ Add http cache support.#33
iota9star wants to merge 9 commits into
fluttercandies:masterfrom
iota9star:feature/support-network-cache

Conversation

@iota9star

@iota9star iota9star commented Jul 22, 2021

Copy link
Copy Markdown
Member
  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
Copy Markdown
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),
);

Comment thread lib/src/_network_image_io.dart Outdated
final Directory dir = Directory(
join((await getTemporaryDirectory()).path, cacheImageFolderName));
// ignore: avoid_slow_async_io
if (!await dir.exists()) {

Copy link
Copy Markdown
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()) {

Comment thread lib/src/_network_image_io.dart Outdated
} else {
final File lockFile = _childFile(parentDir, '$rawFileName.lock');
// ignore: avoid_slow_async_io
final bool exist = await lockFile.exists();

Copy link
Copy Markdown
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