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
|
|
@ -13,13 +13,7 @@ import 'package:octo_image/octo_image.dart';
|
|||
import 'package:immich_mobile/providers/user.provider.dart';
|
||||
|
||||
class ImmichThumbnail extends HookConsumerWidget {
|
||||
const ImmichThumbnail({
|
||||
this.asset,
|
||||
this.width = 250,
|
||||
this.height = 250,
|
||||
this.fit = BoxFit.cover,
|
||||
super.key,
|
||||
});
|
||||
const ImmichThumbnail({this.asset, this.width = 250, this.height = 250, this.fit = BoxFit.cover, super.key});
|
||||
|
||||
final Asset? asset;
|
||||
final double width;
|
||||
|
|
@ -30,35 +24,19 @@ class ImmichThumbnail extends HookConsumerWidget {
|
|||
/// 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,
|
||||
String? userId,
|
||||
int thumbnailSize = 256,
|
||||
}) {
|
||||
static ImageProvider imageProvider({Asset? asset, String? assetId, String? userId, int thumbnailSize = 256}) {
|
||||
if (asset == null && assetId == null) {
|
||||
throw Exception('Must supply either asset or assetId');
|
||||
}
|
||||
|
||||
if (asset == null) {
|
||||
return ImmichRemoteThumbnailProvider(
|
||||
assetId: assetId!,
|
||||
);
|
||||
return ImmichRemoteThumbnailProvider(assetId: assetId!);
|
||||
}
|
||||
|
||||
if (ImmichImage.useLocal(asset)) {
|
||||
return ImmichLocalThumbnailProvider(
|
||||
asset: asset,
|
||||
height: thumbnailSize,
|
||||
width: thumbnailSize,
|
||||
userId: userId,
|
||||
);
|
||||
return ImmichLocalThumbnailProvider(asset: asset, height: thumbnailSize, width: thumbnailSize, userId: userId);
|
||||
} else {
|
||||
return ImmichRemoteThumbnailProvider(
|
||||
assetId: asset.remoteId!,
|
||||
height: thumbnailSize,
|
||||
width: thumbnailSize,
|
||||
);
|
||||
return ImmichRemoteThumbnailProvider(assetId: asset.remoteId!, height: thumbnailSize, width: thumbnailSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -72,23 +50,13 @@ class ImmichThumbnail extends HookConsumerWidget {
|
|||
color: Colors.grey,
|
||||
width: width,
|
||||
height: height,
|
||||
child: const Center(
|
||||
child: Icon(Icons.no_photography),
|
||||
),
|
||||
child: const Center(child: Icon(Icons.no_photography)),
|
||||
);
|
||||
}
|
||||
|
||||
final assetAltText = getAltText(
|
||||
asset!.exifInfo,
|
||||
asset!.fileCreatedAt,
|
||||
asset!.type,
|
||||
[],
|
||||
);
|
||||
final assetAltText = getAltText(asset!.exifInfo, asset!.fileCreatedAt, asset!.type, []);
|
||||
|
||||
final thumbnailProviderInstance = ImmichThumbnail.imageProvider(
|
||||
asset: asset,
|
||||
userId: userId,
|
||||
);
|
||||
final thumbnailProviderInstance = ImmichThumbnail.imageProvider(asset: asset, userId: userId);
|
||||
|
||||
customErrorBuilder(BuildContext ctx, Object error, StackTrace? stackTrace) {
|
||||
thumbnailProviderInstance.evict();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue