mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -28,32 +28,19 @@ class ImmichImage extends StatelessWidget {
|
|||
// either by using the asset ID or the asset itself
|
||||
/// [asset] is the Asset to request, or else use [assetId] to get a remote
|
||||
/// image provider
|
||||
static ImageProvider imageProvider({
|
||||
Asset? asset,
|
||||
String? assetId,
|
||||
double width = 1080,
|
||||
double height = 1920,
|
||||
}) {
|
||||
static ImageProvider imageProvider({Asset? asset, String? assetId, double width = 1080, double height = 1920}) {
|
||||
if (asset == null && assetId == null) {
|
||||
throw Exception('Must supply either asset or assetId');
|
||||
}
|
||||
|
||||
if (asset == null) {
|
||||
return ImmichRemoteImageProvider(
|
||||
assetId: assetId!,
|
||||
);
|
||||
return ImmichRemoteImageProvider(assetId: assetId!);
|
||||
}
|
||||
|
||||
if (useLocal(asset)) {
|
||||
return ImmichLocalImageProvider(
|
||||
asset: asset,
|
||||
width: width,
|
||||
height: height,
|
||||
);
|
||||
return ImmichLocalImageProvider(asset: asset, width: width, height: height);
|
||||
} else {
|
||||
return ImmichRemoteImageProvider(
|
||||
assetId: asset.remoteId!,
|
||||
);
|
||||
return ImmichRemoteImageProvider(assetId: asset.remoteId!);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,17 +55,11 @@ class ImmichImage extends StatelessWidget {
|
|||
color: Colors.grey,
|
||||
width: width,
|
||||
height: height,
|
||||
child: const Center(
|
||||
child: Icon(Icons.no_photography),
|
||||
),
|
||||
child: const Center(child: Icon(Icons.no_photography)),
|
||||
);
|
||||
}
|
||||
|
||||
final imageProviderInstance = ImmichImage.imageProvider(
|
||||
asset: asset,
|
||||
width: context.width,
|
||||
height: context.height,
|
||||
);
|
||||
final imageProviderInstance = ImmichImage.imageProvider(asset: asset, width: context.width, height: context.height);
|
||||
|
||||
return OctoImage(
|
||||
fadeInDuration: const Duration(milliseconds: 0),
|
||||
|
|
@ -96,11 +77,7 @@ class ImmichImage extends StatelessWidget {
|
|||
errorBuilder: (context, error, stackTrace) {
|
||||
imageProviderInstance.evict();
|
||||
|
||||
return Icon(
|
||||
Icons.image_not_supported_outlined,
|
||||
size: 32,
|
||||
color: Colors.red[200],
|
||||
);
|
||||
return Icon(Icons.image_not_supported_outlined, size: 32, color: Colors.red[200]);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue