Skip to content

[Impeller] Blurred widget flickers during animation #127173

@AlexDochioiu

Description

@AlexDochioiu

Is there an existing issue for this?

Steps to reproduce

I attached the code below for the class that I use.

Expected results

No flicker

Actual results

Flicker while animation is ongoing

Code sample

Code sample

Using package

gauge_indicator: ^0.4.0-dev.5

Widgets

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

  @override
  Widget build(BuildContext context) {
    const segments = <GaugeSegment>[
      GaugeSegment(from: 0, to: 20.0, color: Colors.transparent, cornerRadius: Radius.circular(10)),
      GaugeSegment(from: 20.0, to: 40.0, color: Colors.transparent, cornerRadius: Radius.circular(10)),
      GaugeSegment(from: 40.0, to: 60, color: Colors.transparent, cornerRadius: Radius.circular(10)),
      GaugeSegment(from: 60.0, to: 80, color: Colors.transparent, cornerRadius: Radius.circular(10)),
      GaugeSegment(from: 80.0, to: 100, color: Colors.transparent, cornerRadius: Radius.circular(10)),
    ];

    return Blurred(
      key: UniqueKey(), // temp unique key to redo animation on hot reload
      tileMode: TileMode.decal,
      child: const _RadialGaugeWidget(value: 0.8, segments: segments),
    );
  }
}
class Blurred extends ImageFiltered {
  Blurred({required Widget child, double sigmaX = 5, double sigmaY = 5, TileMode tileMode = TileMode.clamp, Key? key})
      : super(
          imageFilter: ImageFilter.blur(sigmaX: sigmaX, sigmaY: sigmaY, tileMode: tileMode),
          child: child,
          key: key,
        );
}
class _RadialGaugeWidget extends StatelessWidget {
  const _RadialGaugeWidget({
    Key? key,
    required this.segments,
    required this.value,
  }) : super(key: key);

  final List<GaugeSegment> segments;
  final double value;

  @override
  Widget build(BuildContext context) {
    return AnimatedRadialGauge(
      radius: MediaQuery.of(context).size.width / 2 - SizeConst.WINDOW_INSET,
      duration: const Duration(seconds: 2),
      curve: Curves.fastLinearToSlowEaseIn,
      value: value * 100,
      progressBar: const GaugeProgressBar.rounded(
        gradient: GaugeAxisGradient(
          colors: [Color(0xFFB881FF), Color(0xFF68E4FF), Color(0xFFFDFFA0)],
          colorStops: [0, 0.5, 1],
        ),
        placement: GaugeProgressPlacement.inside,
      ),
      axis: GaugeAxis(
        degrees: 180,
        style: GaugeAxisStyle(
          thickness: (MediaQuery.of(context).size.width / 20).bound(18, 24),
          segmentSpacing: 8,
          blendColors: false,
          cornerRadius: const Radius.circular(20),
        ),
        segments: segments,
      ),
    );
  }
}

Screenshots or Video

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-05-19.at.11.13.44.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.1, on macOS 13.3.1 22E772610a darwin-arm64, locale en-GB)
    • Flutter version 3.10.1 on channel stable at /Users/alexandrudochioiu/.asdf/installs/flutter/3.10.1-stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d3d8effc68 (2 days ago), 2023-05-16 17:59:05 -0700
    • Engine revision b4fb11214d
    • Dart version 3.0.1
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/alexandrudochioiu/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = /Users/alexandrudochioiu/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] VS Code (version 1.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (3 available)
    • iPhone 14 Pro (mobile) • A1A6A512-11DF-47F0-B0E6-30171868398B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions