Repository navigation
Description
Steps to reproduce
- Create a ButtonStyle
- Add a foregroundBuilder
foregroundBuilder: (context, states, child) {
return AnimatedContainer(
duration: kThemeAnimationDuration,
decoration: BoxDecoration(
color: states.contains(WidgetState.hovered)
? _white.withValues(alpha: 0.5)
: _white.withValues(alpha: 0),
backgroundBlendMode: BlendMode.overlay,
borderRadius: BorderRadius.circular(5),
),
child: child,
);
},
Expected results
Expect interpolated frames to use BlendMode.overlay when drawing
Actual results
Instead of smooth interpolation, it is flickering, as if it's using default blend mode in between
Code sample
Screenshots or Video
Screen.Recording.2025-03-07.at.12.44.16.mov
Logs
Flutter Doctor output
[✓] Flutter (Channel stable, 3.29.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-EE) [254ms]
• Flutter version 3.29.0 on channel stable at /Users/roman/fvm/versions/3.29.0
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388a (4 weeks ago), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4
• Dart version 3.7.0
• DevTools version 2.42.2
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [1,288ms]
• Android SDK at /Users/roman/Library/Android/sdk
• Platform android-35, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3) [943ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [11ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) [10ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.97.0) [9ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.104.0
[✓] Connected device (3 available) [7.2s]
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.44
[✓] Network resources [242ms]
• All expected network resources are available.
Activity
benthillerkus commentedon Mar 7, 2025
Can't comment on the rendering issue, but if you're using the overlay blend mode, there is no need to animate the alpha, you can just animate the brightness of the foreground. Conversely, if you can just animate the alpha, there is no need to use a special blend mode.
Unfortunately the link to Dartpad is broken.
maheshj01 commentedon Mar 8, 2025
Hi @Pomis, Thanks for filing the issue. Please share the complete sample code to investigate the issue ( The shared link to dartpad is broken)
Pomis commentedon Mar 8, 2025
Oops, sorry, the working link: https://dartpad.dev/?id=b937d2672f4d177e9ba34b656b3780ed
maheshj01 commentedon Mar 10, 2025
Reproducible on the latest stable and the master channel.
AnimatedContainer.decoration.backgroundBlendModeflickers when animating colorScreen.Recording.2025-03-10.at.18.24.40.mov
minimal code sample
flutter doctor -v
6 remaining items
Renzo-Olivares commentedon Oct 20, 2026
This is still reproducible on master, potentially due to
BoxDecoration.lerpandBoxDecoration.scaleomittingbackgroundBlendModein their newly constructedBoxDecoration.