mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	formatting
This commit is contained in:
		
							parent
							
								
									b81081e777
								
							
						
					
					
						commit
						4f19dacecd
					
				@ -36,11 +36,7 @@ class AssetMediaRepository {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<Uint8List?> getThumbnail(
 | 
			
		||||
    String id, {
 | 
			
		||||
    int quality = 80,
 | 
			
		||||
    ui.Size size = const ui.Size.square(256),
 | 
			
		||||
  }) =>
 | 
			
		||||
  Future<Uint8List?> getThumbnail(String id, {int quality = 80, ui.Size size = const ui.Size.square(256)}) =>
 | 
			
		||||
      AssetEntity(
 | 
			
		||||
        id: id,
 | 
			
		||||
        // The below fields are not used in thumbnailDataWithSize but are required
 | 
			
		||||
@ -49,8 +45,5 @@ class AssetMediaRepository {
 | 
			
		||||
        typeInt: AssetType.image.index,
 | 
			
		||||
        width: size.width.toInt(),
 | 
			
		||||
        height: size.height.toInt(),
 | 
			
		||||
      ).thumbnailDataWithSize(
 | 
			
		||||
        ThumbnailSize(size.width.toInt(), size.height.toInt()),
 | 
			
		||||
        quality: quality,
 | 
			
		||||
      );
 | 
			
		||||
      ).thumbnailDataWithSize(ThumbnailSize(size.width.toInt(), size.height.toInt()), quality: quality);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -163,9 +163,7 @@ class _PlaceTile extends StatelessWidget {
 | 
			
		||||
      onTap: () => context.pushRoute(DriftPlaceDetailRoute(place: place.$1)),
 | 
			
		||||
      title: Text(place.$1, style: context.textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w500)),
 | 
			
		||||
      leading: ClipRRect(
 | 
			
		||||
        borderRadius: const BorderRadius.all(
 | 
			
		||||
          Radius.circular(20),
 | 
			
		||||
        ),
 | 
			
		||||
        borderRadius: const BorderRadius.all(Radius.circular(20)),
 | 
			
		||||
        child: Thumbnail(
 | 
			
		||||
          imageProvider: RemoteThumbProvider(assetId: place.$2),
 | 
			
		||||
          size: const Size(80, 80),
 | 
			
		||||
 | 
			
		||||
@ -444,7 +444,11 @@ class _AlbumList extends ConsumerWidget {
 | 
			
		||||
              leading: album.thumbnailAssetId != null
 | 
			
		||||
                  ? ClipRRect(
 | 
			
		||||
                      borderRadius: const BorderRadius.all(Radius.circular(15)),
 | 
			
		||||
                      child: SizedBox(width: 80, height: 80, child: Thumbnail(imageProvider: RemoteThumbProvider(assetId: album.thumbnailAssetId!))),
 | 
			
		||||
                      child: SizedBox(
 | 
			
		||||
                        width: 80,
 | 
			
		||||
                        height: 80,
 | 
			
		||||
                        child: Thumbnail(imageProvider: RemoteThumbProvider(assetId: album.thumbnailAssetId!)),
 | 
			
		||||
                      ),
 | 
			
		||||
                    )
 | 
			
		||||
                  : SizedBox(
 | 
			
		||||
                      width: 80,
 | 
			
		||||
 | 
			
		||||
@ -93,10 +93,7 @@ class AssetViewerStateNotifier extends AutoDisposeNotifier<AssetViewerState> {
 | 
			
		||||
    if (showing == state.showingBottomSheet) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    state = state.copyWith(
 | 
			
		||||
      showingBottomSheet: showing,
 | 
			
		||||
      showingControls: showing || state.showingControls,
 | 
			
		||||
    );
 | 
			
		||||
    state = state.copyWith(showingBottomSheet: showing, showingControls: showing || state.showingControls);
 | 
			
		||||
    if (showing) {
 | 
			
		||||
      ref.read(videoPlayerControlsProvider.notifier).pause();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -12,11 +12,7 @@ class LocalThumbProvider extends ImageProvider<LocalThumbProvider> {
 | 
			
		||||
  final Size size;
 | 
			
		||||
  final DateTime? updatedAt;
 | 
			
		||||
 | 
			
		||||
  const LocalThumbProvider({
 | 
			
		||||
    required this.id,
 | 
			
		||||
    required this.size,
 | 
			
		||||
    this.updatedAt,
 | 
			
		||||
  });
 | 
			
		||||
  const LocalThumbProvider({required this.id, required this.size, this.updatedAt});
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Future<LocalThumbProvider> obtainKey(ImageConfiguration configuration) {
 | 
			
		||||
@ -24,10 +20,7 @@ class LocalThumbProvider extends ImageProvider<LocalThumbProvider> {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  ImageStreamCompleter loadImage(
 | 
			
		||||
    LocalThumbProvider key,
 | 
			
		||||
    ImageDecoderCallback decode,
 | 
			
		||||
  ) {
 | 
			
		||||
  ImageStreamCompleter loadImage(LocalThumbProvider key, ImageDecoderCallback decode) {
 | 
			
		||||
    return OneFrameImageStreamCompleter(
 | 
			
		||||
      _codec(key),
 | 
			
		||||
      informationCollector: () => <DiagnosticsNode>[
 | 
			
		||||
@ -70,10 +63,7 @@ class LocalFullImageProvider extends ImageProvider<LocalFullImageProvider> {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  ImageStreamCompleter loadImage(
 | 
			
		||||
    LocalFullImageProvider key,
 | 
			
		||||
    ImageDecoderCallback decode,
 | 
			
		||||
  ) {
 | 
			
		||||
  ImageStreamCompleter loadImage(LocalFullImageProvider key, ImageDecoderCallback decode) {
 | 
			
		||||
    return OneFrameImageStreamCompleter(_codec(key));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -65,10 +65,7 @@ class Thumbnail extends StatefulWidget {
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static ImageProvider? _getImageProviderFromBaseAsset(
 | 
			
		||||
    BaseAsset? asset,
 | 
			
		||||
    ui.Size size,
 | 
			
		||||
  ) {
 | 
			
		||||
  static ImageProvider? _getImageProviderFromBaseAsset(BaseAsset? asset, ui.Size size) {
 | 
			
		||||
    switch (asset) {
 | 
			
		||||
      case RemoteAsset():
 | 
			
		||||
        if (asset.localId != null) {
 | 
			
		||||
@ -217,19 +214,12 @@ class _ThumbnailState extends State<Thumbnail> {
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final colorScheme = context.colorScheme;
 | 
			
		||||
    final gradient = _gradientCache[colorScheme] ??= LinearGradient(
 | 
			
		||||
      colors: [
 | 
			
		||||
        colorScheme.surfaceContainer,
 | 
			
		||||
        colorScheme.surfaceContainer.darken(amount: .1),
 | 
			
		||||
      ],
 | 
			
		||||
      colors: [colorScheme.surfaceContainer, colorScheme.surfaceContainer.darken(amount: .1)],
 | 
			
		||||
      begin: Alignment.topCenter,
 | 
			
		||||
      end: Alignment.bottomCenter,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    return _ThumbnailLeaf(
 | 
			
		||||
      image: _providerImage,
 | 
			
		||||
      fit: widget.fit,
 | 
			
		||||
      placeholderGradient: gradient,
 | 
			
		||||
    );
 | 
			
		||||
    return _ThumbnailLeaf(image: _providerImage, fit: widget.fit, placeholderGradient: gradient);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
@ -245,26 +235,15 @@ class _ThumbnailLeaf extends LeafRenderObjectWidget {
 | 
			
		||||
  final BoxFit fit;
 | 
			
		||||
  final Gradient placeholderGradient;
 | 
			
		||||
 | 
			
		||||
  const _ThumbnailLeaf({
 | 
			
		||||
    required this.image,
 | 
			
		||||
    required this.fit,
 | 
			
		||||
    required this.placeholderGradient,
 | 
			
		||||
  });
 | 
			
		||||
  const _ThumbnailLeaf({required this.image, required this.fit, required this.placeholderGradient});
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  RenderObject createRenderObject(BuildContext context) {
 | 
			
		||||
    return _ThumbnailRenderBox(
 | 
			
		||||
      image: image,
 | 
			
		||||
      fit: fit,
 | 
			
		||||
      placeholderGradient: placeholderGradient,
 | 
			
		||||
    );
 | 
			
		||||
    return _ThumbnailRenderBox(image: image, fit: fit, placeholderGradient: placeholderGradient);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void updateRenderObject(
 | 
			
		||||
    BuildContext context,
 | 
			
		||||
    _ThumbnailRenderBox renderObject,
 | 
			
		||||
  ) {
 | 
			
		||||
  void updateRenderObject(BuildContext context, _ThumbnailRenderBox renderObject) {
 | 
			
		||||
    renderObject.fit = fit;
 | 
			
		||||
    renderObject.image = image;
 | 
			
		||||
    renderObject.placeholderGradient = placeholderGradient;
 | 
			
		||||
@ -285,11 +264,8 @@ class _ThumbnailRenderBox extends RenderBox {
 | 
			
		||||
  @override
 | 
			
		||||
  bool isRepaintBoundary = true;
 | 
			
		||||
 | 
			
		||||
  _ThumbnailRenderBox({
 | 
			
		||||
    required ui.Image? image,
 | 
			
		||||
    required BoxFit fit,
 | 
			
		||||
    required Gradient placeholderGradient,
 | 
			
		||||
  })  : _image = image,
 | 
			
		||||
  _ThumbnailRenderBox({required ui.Image? image, required BoxFit fit, required Gradient placeholderGradient})
 | 
			
		||||
    : _image = image,
 | 
			
		||||
      _fit = fit,
 | 
			
		||||
      _placeholderGradient = placeholderGradient,
 | 
			
		||||
      _lastImageRequest = DateTime.now();
 | 
			
		||||
 | 
			
		||||
@ -91,20 +91,14 @@ class ThumbnailTile extends ConsumerWidget {
 | 
			
		||||
                      ? const Align(
 | 
			
		||||
                          alignment: Alignment.topRight,
 | 
			
		||||
                          child: Padding(
 | 
			
		||||
                            padding: EdgeInsets.only(
 | 
			
		||||
                              right: 10.0,
 | 
			
		||||
                              top: 24.0,
 | 
			
		||||
                            ),
 | 
			
		||||
                            padding: EdgeInsets.only(right: 10.0, top: 24.0),
 | 
			
		||||
                            child: _TileOverlayIcon(Icons.burst_mode_rounded),
 | 
			
		||||
                          ),
 | 
			
		||||
                        )
 | 
			
		||||
                      : const Align(
 | 
			
		||||
                          alignment: Alignment.topRight,
 | 
			
		||||
                          child: Padding(
 | 
			
		||||
                            padding: EdgeInsets.only(
 | 
			
		||||
                              right: 10.0,
 | 
			
		||||
                              top: 6.0,
 | 
			
		||||
                            ),
 | 
			
		||||
                            padding: EdgeInsets.only(right: 10.0, top: 6.0),
 | 
			
		||||
                            child: _TileOverlayIcon(Icons.burst_mode_rounded),
 | 
			
		||||
                          ),
 | 
			
		||||
                        ),
 | 
			
		||||
 | 
			
		||||
@ -102,10 +102,7 @@ class _BlurredBackdrop extends HookWidget {
 | 
			
		||||
      child: DecoratedBox(
 | 
			
		||||
        decoration: BoxDecoration(
 | 
			
		||||
          image: DecorationImage(
 | 
			
		||||
            image: getFullImageProvider(
 | 
			
		||||
              asset,
 | 
			
		||||
              size: Size(context.width, context.height),
 | 
			
		||||
            ),
 | 
			
		||||
            image: getFullImageProvider(asset, size: Size(context.width, context.height)),
 | 
			
		||||
            fit: BoxFit.cover,
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
 | 
			
		||||
@ -57,15 +57,8 @@ class DriftMemoryCard extends ConsumerWidget {
 | 
			
		||||
      child: Stack(
 | 
			
		||||
        children: [
 | 
			
		||||
          ColorFiltered(
 | 
			
		||||
            colorFilter: ColorFilter.mode(
 | 
			
		||||
              Colors.black.withValues(alpha: 0.2),
 | 
			
		||||
              BlendMode.darken,
 | 
			
		||||
            ),
 | 
			
		||||
            child: SizedBox(
 | 
			
		||||
              width: 205,
 | 
			
		||||
              height: 200,
 | 
			
		||||
              child: Thumbnail.fromBaseAsset(asset: memory.assets[0]),
 | 
			
		||||
            ),
 | 
			
		||||
            colorFilter: ColorFilter.mode(Colors.black.withValues(alpha: 0.2), BlendMode.darken),
 | 
			
		||||
            child: SizedBox(width: 205, height: 200, child: Thumbnail.fromBaseAsset(asset: memory.assets[0])),
 | 
			
		||||
          ),
 | 
			
		||||
          Positioned(
 | 
			
		||||
            bottom: 16,
 | 
			
		||||
 | 
			
		||||
@ -41,7 +41,10 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
 | 
			
		||||
        borderRadius: const BorderRadius.all(Radius.circular(12)),
 | 
			
		||||
        child: Badge(
 | 
			
		||||
          label: const DecoratedBox(
 | 
			
		||||
            decoration: BoxDecoration(color: Colors.black, borderRadius: BorderRadius.all(Radius.circular(widgetSize / 2))),
 | 
			
		||||
            decoration: BoxDecoration(
 | 
			
		||||
              color: Colors.black,
 | 
			
		||||
              borderRadius: BorderRadius.all(Radius.circular(widgetSize / 2)),
 | 
			
		||||
            ),
 | 
			
		||||
            child: Icon(Icons.info, color: Color.fromARGB(255, 243, 188, 106), size: widgetSize / 2),
 | 
			
		||||
          ),
 | 
			
		||||
          backgroundColor: Colors.transparent,
 | 
			
		||||
 | 
			
		||||
@ -101,11 +101,7 @@ class _BlurredBackdrop extends HookWidget {
 | 
			
		||||
      child: DecoratedBox(
 | 
			
		||||
        decoration: BoxDecoration(
 | 
			
		||||
          image: DecorationImage(
 | 
			
		||||
            image: ImmichImage.imageProvider(
 | 
			
		||||
              asset: asset,
 | 
			
		||||
              height: context.height,
 | 
			
		||||
              width: context.width,
 | 
			
		||||
            ),
 | 
			
		||||
            image: ImmichImage.imageProvider(asset: asset, height: context.height, width: context.width),
 | 
			
		||||
            fit: BoxFit.cover,
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user