From cde8845c3b47859802b39c0b2c29ecd6fb08ee51 Mon Sep 17 00:00:00 2001 From: Vladislav Shturma Date: Mon, 12 Jan 2026 19:51:31 +0400 Subject: [PATCH] fix transparent frame before displaying blurhash image --- lib/src/blurhash_widget.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/blurhash_widget.dart b/lib/src/blurhash_widget.dart index ee24cbd..4ac086b 100644 --- a/lib/src/blurhash_widget.dart +++ b/lib/src/blurhash_widget.dart @@ -159,7 +159,17 @@ class BlurHashState extends State { Widget buildBlurHashBackground() => FutureBuilder( future: _image, builder: (ctx, snap) => snap.hasData - ? Image(image: UiImage(snap.data!), fit: widget.imageFit) + ? Image( + image: UiImage(snap.data!), + fit: widget.imageFit, + frameBuilder: (context, child, frame, wasSynchronouslyLoaded) { + if (wasSynchronouslyLoaded || frame != null) { + return child; + } + + return Container(color: widget.color); + }, + ) : Container(color: widget.color), ); }