mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
formatting
This commit is contained in:
parent
ce1585255e
commit
39e4f2b4c3
@ -23,8 +23,7 @@ class AssetMediaRepository {
|
||||
final actualSize = actualWidth * actualHeight * 4;
|
||||
|
||||
try {
|
||||
final buffer =
|
||||
await ImmutableBuffer.fromUint8List(pointer.asTypedList(actualSize));
|
||||
final buffer = await ImmutableBuffer.fromUint8List(pointer.asTypedList(actualSize));
|
||||
final descriptor = ui.ImageDescriptor.raw(
|
||||
buffer,
|
||||
width: actualWidth,
|
||||
|
@ -69,8 +69,7 @@ Future<void> initApp() async {
|
||||
}
|
||||
}
|
||||
|
||||
PaintingBinding.instance.imageCache.maximumSizeBytes =
|
||||
kTimelineImageCacheMemory;
|
||||
PaintingBinding.instance.imageCache.maximumSizeBytes = kTimelineImageCacheMemory;
|
||||
|
||||
await DynamicTheme.fetchSystemPalette();
|
||||
|
||||
|
@ -482,7 +482,7 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||
height: double.infinity,
|
||||
color: backgroundColor,
|
||||
child: Thumbnail.fromBaseAsset(
|
||||
asset: asset,
|
||||
asset: asset,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
);
|
||||
@ -588,10 +588,7 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||
// Using multiple selectors to avoid unnecessary rebuilds for other state changes
|
||||
ref.watch(
|
||||
assetViewerProvider.select(
|
||||
(s) =>
|
||||
s.showingBottomSheet.hashCode ^
|
||||
s.backgroundOpacity.hashCode ^
|
||||
s.stackIndex.hashCode,
|
||||
(s) => s.showingBottomSheet.hashCode ^ s.backgroundOpacity.hashCode ^ s.stackIndex.hashCode,
|
||||
),
|
||||
);
|
||||
ref.watch(isPlayingMotionVideoProvider);
|
||||
|
@ -77,7 +77,7 @@ class AssetViewerStateNotifier extends AutoDisposeNotifier<AssetViewerState> {
|
||||
void setAsset(BaseAsset? asset) {
|
||||
if (asset != state.currentAsset) {
|
||||
state = state.copyWith(currentAsset: asset, stackIndex: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setOpacity(int opacity) {
|
||||
|
@ -40,8 +40,7 @@ class LocalThumbProvider extends ImageProvider<LocalThumbProvider> {
|
||||
}
|
||||
|
||||
Future<ImageInfo> _codec(LocalThumbProvider key) async {
|
||||
final codec =
|
||||
await _assetMediaRepository.getLocalThumbnail(key.id, key.size);
|
||||
final codec = await _assetMediaRepository.getLocalThumbnail(key.id, key.size);
|
||||
return ImageInfo(image: (await codec.getNextFrame()).image, scale: 1.0);
|
||||
}
|
||||
|
||||
@ -49,9 +48,7 @@ class LocalThumbProvider extends ImageProvider<LocalThumbProvider> {
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
if (other is LocalThumbProvider) {
|
||||
return id == other.id &&
|
||||
size == other.size &&
|
||||
updatedAt == other.updatedAt;
|
||||
return id == other.id && size == other.size && updatedAt == other.updatedAt;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -82,8 +79,7 @@ class LocalFullImageProvider extends ImageProvider<LocalFullImageProvider> {
|
||||
}
|
||||
|
||||
Future<ImageInfo> _codec(LocalFullImageProvider key) async {
|
||||
final devicePixelRatio =
|
||||
PlatformDispatcher.instance.views.first.devicePixelRatio;
|
||||
final devicePixelRatio = PlatformDispatcher.instance.views.first.devicePixelRatio;
|
||||
final codec = await _assetMediaRepository.getLocalThumbnail(
|
||||
key.id,
|
||||
Size(size.width * devicePixelRatio, size.height * devicePixelRatio),
|
||||
|
@ -106,8 +106,7 @@ class _ThumbnailState extends State<Thumbnail> {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.imageProvider != widget.imageProvider ||
|
||||
oldWidget.blurhash != widget.blurhash ||
|
||||
(oldWidget.thumbhashMode == ThumbhashMode.disabled &&
|
||||
oldWidget.thumbhashMode != ThumbhashMode.disabled)) {
|
||||
(oldWidget.thumbhashMode == ThumbhashMode.disabled && oldWidget.thumbhashMode != ThumbhashMode.disabled)) {
|
||||
_loadImage();
|
||||
}
|
||||
}
|
||||
@ -120,13 +119,11 @@ class _ThumbnailState extends State<Thumbnail> {
|
||||
|
||||
void _loadImage() {
|
||||
_stopListeningToStream();
|
||||
if (widget.thumbhashMode != ThumbhashMode.disabled &&
|
||||
widget.blurhash != null) {
|
||||
if (widget.thumbhashMode != ThumbhashMode.disabled && widget.blurhash != null) {
|
||||
_decodeThumbhash();
|
||||
}
|
||||
|
||||
if (widget.thumbhashMode != ThumbhashMode.only &&
|
||||
widget.imageProvider != null) {
|
||||
if (widget.thumbhashMode != ThumbhashMode.only && widget.imageProvider != null) {
|
||||
_loadFromProvider();
|
||||
}
|
||||
}
|
||||
@ -298,9 +295,7 @@ class _ThumbnailRenderBox extends RenderBox {
|
||||
|
||||
if (_fadeStartTime != null) {
|
||||
final elapsed = DateTime.now().difference(_fadeStartTime!);
|
||||
_crossFadeProgress =
|
||||
(elapsed.inMilliseconds / _fadeDuration.inMilliseconds)
|
||||
.clamp(0.0, 1.0);
|
||||
_crossFadeProgress = (elapsed.inMilliseconds / _fadeDuration.inMilliseconds).clamp(0.0, 1.0);
|
||||
|
||||
if (_crossFadeProgress < 1.0) {
|
||||
SchedulerBinding.instance.scheduleFrameCallback((_) {
|
||||
|
@ -40,8 +40,7 @@ class ThumbnailTile extends ConsumerWidget {
|
||||
final isSelected = ref.watch(
|
||||
multiSelectProvider.select((multiselect) => multiselect.selectedAssets.contains(asset)),
|
||||
);
|
||||
final isScrubbing =
|
||||
ref.watch(timelineStateProvider.select((state) => state.isScrubbing));
|
||||
final isScrubbing = ref.watch(timelineStateProvider.select((state) => state.isScrubbing));
|
||||
|
||||
final borderStyle = lockSelection
|
||||
? BoxDecoration(
|
||||
@ -74,9 +73,7 @@ class ThumbnailTile extends ConsumerWidget {
|
||||
tag: '${asset?.heroTag ?? ''}_$heroIndex',
|
||||
child: Thumbnail.fromBaseAsset(
|
||||
asset: asset,
|
||||
thumbhashMode: isScrubbing
|
||||
? ThumbhashMode.only
|
||||
: ThumbhashMode.enabled,
|
||||
thumbhashMode: isScrubbing ? ThumbhashMode.only : ThumbhashMode.enabled,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -61,11 +61,11 @@ class DriftMemoryCard extends ConsumerWidget {
|
||||
Colors.black.withValues(alpha: 0.2),
|
||||
BlendMode.darken,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 205,
|
||||
height: 200,
|
||||
child: Thumbnail.fromBaseAsset(asset: memory.assets[0]),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 205,
|
||||
height: 200,
|
||||
child: Thumbnail.fromBaseAsset(asset: memory.assets[0]),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 16,
|
||||
|
@ -130,8 +130,8 @@ class _FixedSegmentRow extends ConsumerWidget {
|
||||
future: timelineService.loadAssets(assetIndex, assetCount),
|
||||
builder: (context, snapshot) {
|
||||
return _buildAssetRow(context, snapshot.data, timelineService);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,14 +212,12 @@ class _AssetTileWidget extends ConsumerWidget {
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => lockSelection || asset == null ? null : _handleOnTap(context, ref, assetIndex, asset, heroOffset),
|
||||
onLongPress: () => lockSelection || asset == null
|
||||
? null
|
||||
: _handleOnLongPress(ref, asset),
|
||||
child: ThumbnailTile(
|
||||
asset,
|
||||
lockSelection: lockSelection,
|
||||
showStorageIndicator: showStorageIndicator,
|
||||
heroOffset: heroOffset,
|
||||
onLongPress: () => lockSelection || asset == null ? null : _handleOnLongPress(ref, asset),
|
||||
child: ThumbnailTile(
|
||||
asset,
|
||||
lockSelection: lockSelection,
|
||||
showStorageIndicator: showStorageIndicator,
|
||||
heroOffset: heroOffset,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -68,8 +68,7 @@ class ImmichThumbnail extends HookConsumerWidget {
|
||||
fadeInDuration: Duration.zero,
|
||||
fadeOutDuration: const Duration(milliseconds: 100),
|
||||
octoSet: OctoSet(
|
||||
placeholderBuilder:
|
||||
blurHashPlaceholderBuilder(asset?.thumbhash, fit: fit),
|
||||
placeholderBuilder: blurHashPlaceholderBuilder(asset?.thumbhash, fit: fit),
|
||||
errorBuilder: customErrorBuilder,
|
||||
),
|
||||
image: thumbnailProviderInstance,
|
||||
|
Loading…
x
Reference in New Issue
Block a user