feature(mobile): allow app to be used offline (#1932)

* feature(mobile): allow app to be used offline

* translatable server/network error message

* adjust profile drawer error message

* call getAllAsset after cold app starts

* fix analyzer error

* update asset state if length differs

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Fynn Petersen-Frey 2023-03-15 22:29:07 +01:00 committed by GitHub
parent 54831878e0
commit 04955a4123
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 123 additions and 66 deletions

View file

@ -11,15 +11,17 @@ import 'package:photo_manager/photo_manager.dart';
class ImmichImage extends StatelessWidget {
const ImmichImage(
this.asset, {
required this.width,
required this.height,
this.width,
this.height,
this.fit = BoxFit.cover,
this.useGrayBoxPlaceholder = false,
super.key,
});
final Asset? asset;
final bool useGrayBoxPlaceholder;
final double width;
final double height;
final double? width;
final double? height;
final BoxFit fit;
@override
Widget build(BuildContext context) {
@ -47,7 +49,7 @@ class ImmichImage extends StatelessWidget {
),
width: width,
height: height,
fit: BoxFit.cover,
fit: fit,
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
if (wasSynchronouslyLoaded || frame != null) {
return child;
@ -93,7 +95,7 @@ class ImmichImage extends StatelessWidget {
// keeping memCacheWidth, memCacheHeight, maxWidthDiskCache and
// maxHeightDiskCache = null allows to simply store the webp thumbnail
// from the server and use it for all rendered thumbnail sizes
fit: BoxFit.cover,
fit: fit,
fadeInDuration: const Duration(milliseconds: 250),
progressIndicatorBuilder: (context, url, downloadProgress) {
if (useGrayBoxPlaceholder) {