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

Background issue on PNG image #35

Closed
yeasin50 opened this issue Nov 11, 2021 · 3 comments
Closed

Background issue on PNG image #35

yeasin50 opened this issue Nov 11, 2021 · 3 comments

Comments

@yeasin50
Copy link

yeasin50 commented Nov 11, 2021

I am using blurha.sh as mentioned on documentation. While using PNG image, hash effect is still visible on background,

image

Top image is using BlurHash and bottom one using Image.network. For some images I like this effect but for some not. How can get the original image after loading like Image.network.

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  final imageUrl =
      "https://flutter.dev/assets/images/homepage/garden-logos-color/google.png";
  final hash =
      "rOByL6JFEoCA,koaRX\$IS~X8kFo#jXfnf*adf,fP0yxC\${+[I^W=otNarqogkEbdbHfRjXW9jDacj]bcoLjXWVjXW,b0WCs;W.jZWqnzWAjXacjr";

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        AspectRatio(
          key: const ValueKey("GBH"),
          aspectRatio: 200 / 67,
          child: BlurHash(
            hash: hash,
            image: imageUrl,
            color: Colors.green,
          ),
        ),
        Image.network(
          imageUrl,
          key: const ValueKey("GMN"),
        )
      ],
    );
  }
}
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version
    10.0.19043.1348], locale en-US)
    • Flutter version 2.5.3 at C:\Tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git      
    • Framework revision 18116933e7 (4 weeks ago), 2021-10-15 10:46:35      -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4
@romatallinn
Copy link

Yeah, same here. I think there should be an option to remove the blur when image is loaded.

@Solido
Copy link
Member

Solido commented Feb 13, 2022

Hi,
onDisplayed() event is now accessible in the last update so you adjust your display.

@Solido Solido closed this as completed Feb 13, 2022
@ishafiul
Copy link

ishafiul commented Feb 5, 2024

Can someone give me an idea of how to remove a hashed image with the onDisplayed() event?

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

4 participants