flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

Image loads in center then moves to start of container

Open jeprojects opened this issue 2 years ago • 7 comments

🐛 Bug Report

The image fades in the centre of the column and then aligns to the left.

Code

CachedNetworkImage(
        imageUrl: url,
        alignment: Alignment.centerLeft,
        fit: BoxFit.cover,
      )

Expected behavior

Replacing this code with FadeInImage works correctly and fades-in aligned correctly.

Configuration

Version: 3.2.0 Flutter Version: 3

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android

jeprojects avatar May 13 '22 13:05 jeprojects

I faced this bug, also. Any update?

sarakisar97 avatar Oct 31 '22 08:10 sarakisar97

@jeprojects @sarakisar97 I faced the same issue and got it fixed by setting the width to double.infinity for the CachedNetworkImage widget.

CachedNetworkImage(
        imageUrl: 'url',
        height: 32,
        width: double.infinity,
        fit: BoxFit.contain,
        alignment: Alignment.centerLeft,
      )

I hope this helps, not sure if I had a different issue because I see this was for Android but I replicated it with the iOS Simulator.

elenaconache avatar Feb 02 '23 16:02 elenaconache

I have fixed it by wrapping CachedNetworkImage with Row.

SaraAkwad avatar Oct 21 '23 11:10 SaraAkwad

I came across this issue today but have since worked around it by using useOldImageOnUrlChange: true which I want for my use-case anyway.

I think the bug could be fixed by respecting the configured alignment value in the Stack widget used by the octo-image ImageHandler for fading. That is, here do alignment: alignment, instead of alignment: Alignment.center,. I tried it locally and it seemed to do the trick.

timbell avatar Nov 24 '23 15:11 timbell

any update?

seokhyeonSong avatar Feb 16 '24 22:02 seokhyeonSong