Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CachedNetworkImage with placeholder will cause afterimage #1

Open
sleepreading opened this issue Jan 10, 2022 · 2 comments
Open

CachedNetworkImage with placeholder will cause afterimage #1

sleepreading opened this issue Jan 10, 2022 · 2 comments

Comments

@sleepreading
Copy link

RippleEffect(
        pulsations: 2.4,
        dampening: .95,
        child: Container(
          height: 100,
          width: double.infinity,
          child: CachedNetworkImage(
            imageUrl: 'https://xxxx',
            fit: BoxFit.cover,
            placeholder: (ctx, url) => Center(
              // !!! <---  after loading the network image successful, this circle indicator will appear again.
              // !!!     But if I remove the RippleEffect widget, the circle indicator will disappear after successful loading network image.
              child: LoadingIndicator(
                indicatorType: Indicator.ballSpinFadeLoader,
                strokeWidth: 1,
              ),
            ),
          ),
        ),
);

used packages:

cached_network_image: 3.2.0
loading_indicator: 3.0.2

environment:

Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 77d935af4d (3 weeks ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1
@g-apparence
Copy link
Owner

I think I understand the error.
The rippleEffect will cause setState to redraw the background.
You have to use a static image or download it before.

I had in plans to rewrite the widget using a renderObject to avoid this kind of problems.

@sleepreading
Copy link
Author

Supporting network image would be great. Glad to hear that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants