Closed
Description
I am using BackdropFilter to blur the background of cards in a list. When a card scrolls off-screen the blur seems to change based on what is visible which can cause a flickering effect (as seen in the below video).
Is there a way to adjust this behavior so that the blur takes into consideration what is just off-screen?
qemu-system-x86_64_0YorKE9zwB.mp4
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
exaby73 commentedon May 27, 2022
Hello @TheMeanCanEHdian. Can you please provide a minimal, reproducible example so that we can verify this issue?
TheMeanCanEHdian commentedon May 27, 2022
@exaby73 here you go: https://github.com/TheMeanCanEHdian/image_filter_flicker
Additionally, below is an output of
flutter doctor -v
and a video showing the flickering issues withBackdropFilter
as well as an issue preventing me from usingImageFiltered
(including with Material 3 overscroll behavior).qemu-system-x86_64_9ZvzH2WxXZ.mp4
exaby73 commentedon May 30, 2022
This issue is reporducible in latest stable and master channels.
Video
104769_android_stable.mov
Code sample
flutter doctor -v
(Stable)flutter doctor -v
(Master)HansMuller commentedon Jun 2, 2022
@flar - any ideas about why this is happening?
TheMeanCanEHdian commentedon Oct 22, 2022
Hello,
I was wondering if there was any additional insight behind this issue.
flar commentedon Oct 22, 2022
BackdropFilter applies the filter to what is behind the widget. As an item scrolls into view, different parts of it become visible and it can only base its filtered output on what is drawn on screen. As a brighter or darker part of the image becomes visible the resulting blurred pixels will increase or decrease in brightness, but only ever based on what has been rendered underneath the widget. The BackdropFilter is working as intended here, but the desired outcome doesn't match with that specific widget's intended behavior.
The ImageFiltered variant is a better match between what is intended and how the widget works, but the particular implementation is running afoul of attempting to apply a TileMode.clamp sampling mode to a source that doesn't have a defined pixel-aligned edge. As the tiles are slightly scaled when over-scrolling, the background is scaled to N+fraction pixels and the fractional pixels on the edge will "bleed" the blur effect differently as they become nearly full or nearly empty of pixel data. Using TileMode.decal will produce more consistent results with this subtle fraction-of-a-pixel scaling that is happening.
TheMeanCanEHdian commentedon Oct 22, 2022
@flar Thank you for your reply and detailed explanation. I was able to achieve satisfactory results using
TileMode.decal
.github-actions commentedon Nov 7, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -v
and a minimal reproduction of the issue.