Fix animation issue

This commit is contained in:
Neeraj Gupta 2023-07-20 11:49:13 +05:30
parent 8f980a2192
commit 2f41ae72db
2 changed files with 12 additions and 1 deletions

View file

@ -254,6 +254,12 @@ class CollectionsService {
return null;
}
File? getCoverCache(Collection c) {
final int localSyncTime = getCollectionSyncTime(c.id);
final String coverKey = '${c.id}_${localSyncTime}_${c.updationTime}';
return _coverCache[coverKey];
}
Future<int> getFileCount(Collection c) async {
if (_countCache.containsKey(c.id)) {
return _countCache[c.id]!;

View file

@ -59,8 +59,13 @@ class AlbumRowItemWidget extends StatelessWidget {
FutureBuilder<File?>(
future: CollectionsService.instance.getCover(c),
builder: (context, snapshot) {
File? thumbnail;
if (snapshot.hasData) {
final thumbnail = snapshot.data!;
thumbnail = snapshot.data!;
} else {
thumbnail = CollectionsService.instance.getCoverCache(c);
}
if (thumbnail != null) {
final String heroTag = tagPrefix + thumbnail.tag;
return Hero(
tag: heroTag,