Skip to content

Commit

Permalink
cache authors avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
avdosev committed May 3, 2022
1 parent 0f0658e commit 9934ac2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/widgets/author_avatar_icon.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

Expand Down Expand Up @@ -47,8 +48,8 @@ class AuthorAvatarIcon extends StatelessWidget {
if (avatar!.cached) {
image = Image.file(File(avatar!.url!), height: height, width: width);
} else {
image = Image.network(
avatar!.url!,
image = CachedNetworkImage(
imageUrl: avatar!.url!,
height: height,
width: width,
);
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
crypto: ">=2.1.5"
provider: ^6.0.0
itertools: ">=0.1.0"
cached_network_image: ^3.2.0

dependency_overrides:
platform: ^3.1.0
Expand Down

0 comments on commit 9934ac2

Please sign in to comment.