Skip to content

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