feat(mobile): memories (#2988)

* Add page view

* Nice page view

* refactor file structure

* Added card

* invalidating data

* transition

* styling

* correct styleing

* refactor

* click to navigate

* styling

* TODO

* clean up

* clean up

* pr feedback

* pr feedback

* better loading indicator
This commit is contained in:
Alex
2023-06-27 16:00:20 -05:00
committed by GitHub
parent 0e8d235148
commit 39a885a37c
17 changed files with 532 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import 'package:immich_mobile/shared/models/asset.dart';
import 'package:immich_mobile/shared/models/store.dart';
import 'package:immich_mobile/utils/image_url_builder.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:openapi/api.dart' as api;
/// Renders an Asset using local data if available, else remote data
class ImmichImage extends StatelessWidget {
@@ -15,6 +16,7 @@ class ImmichImage extends StatelessWidget {
this.height,
this.fit = BoxFit.cover,
this.useGrayBoxPlaceholder = false,
this.type = api.ThumbnailFormat.WEBP,
super.key,
});
final Asset? asset;
@@ -22,6 +24,7 @@ class ImmichImage extends StatelessWidget {
final double? width;
final double? height;
final BoxFit fit;
final api.ThumbnailFormat type;
@override
Widget build(BuildContext context) {
@@ -85,7 +88,7 @@ class ImmichImage extends StatelessWidget {
);
}
final String? token = Store.get(StoreKey.accessToken);
final String thumbnailRequestUrl = getThumbnailUrl(asset);
final String thumbnailRequestUrl = getThumbnailUrl(asset, type: type);
return CachedNetworkImage(
imageUrl: thumbnailRequestUrl,
httpHeaders: {"Authorization": "Bearer $token"},
@@ -105,7 +108,7 @@ class ImmichImage extends StatelessWidget {
}
return Transform.scale(
scale: 0.2,
child: CircularProgressIndicator(
child: CircularProgressIndicator.adaptive(
value: downloadProgress.progress,
),
);