Skip to content

[Impeller] Animation glitches on iOS #175253

@Z6P0

Description

@Z6P0

Steps to reproduce

The following code randomly display glitches and artifacts on animation when run on iPhone 12 mini (iOS 17.7.1).

Expected results

Text zooming smoothly.

Actual results

Glitches and artifacts, see video.

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() async {
  runApp(MaterialApp(home: const _Test()));
}

class _Test extends StatefulWidget {
  const _Test({super.key});

  @override
  State<_Test> createState() => _TestState();
}

class _TestState extends State<_Test> with WidgetsBindingObserver {
  var key = UniqueKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          GestureDetector(
            child: _Animation(key: key),
            onTap: () async {
              await Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) {
                    SystemChrome.setPreferredOrientations(DeviceOrientation.values);
                    return Scaffold(
                      appBar: AppBar(),
                      body: GestureDetector(onTap: () => Navigator.pop(context)),
                    );
                  },
                ),
              );
              setState(() => key = UniqueKey());
            },
          ),
        ],
      ),
    );
  }
}

class _Animation extends StatefulWidget {
  const _Animation({super.key});

  @override
  State<_Animation> createState() => _AnimationState();
}

class _AnimationState extends State<_Animation> with TickerProviderStateMixin {
  late AnimationController controller;
  late final Animation<double> animationTitleScale;

  @override
  void initState() {
    super.initState();
    SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
    controller = AnimationController(duration: Duration(seconds: 10), vsync: this);
    animationTitleScale = controller.drive(
      Tween<double>(begin: 1, end: 0.04).chain(CurveTween(curve: Curves.easeOutQuart)),
    );
  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    controller.forward();
    return LayoutBuilder(
      builder: (context, constraints) {
        return Scaffold(
          body: AnimatedBuilder(
            animation: animationTitleScale,
            builder: (context, child) => Transform.scale(
              scale: animationTitleScale.value,
              child: OverflowBox(
                maxWidth: double.infinity,
                maxHeight: double.infinity,
                child: Text('BUG', style: TextStyle(fontSize: 2 * constraints.maxHeight)),
              ),
            ),
          ),
        );
      },
    );
  }
}

Screenshots or Video

Video demonstration

Image

Logs

Nothing in logs.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.3, on macOS 14.7.7 23H723 darwin-arm64, locale fr-FR) [304ms]
    • Flutter version 3.35.3 on channel stable at /Users/x/Sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a402d9a437 (8 days ago), 2025-09-03 14:54:31 -0700
    • Engine revision ddf47dd3ff
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc4) [1 575ms]
    • Android SDK at /Users/x/Library/Android/sdk
    • Emulator version 35.3.11.0 (build_id 12836668) (CL:N/A)
    • Platform android-36, build-tools 36.0.0-rc4
    • 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.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [686ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

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

[✓] Android Studio (version 2022.3) [5ms]
    • 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.6b829.9-10027231)

[✓] Connected device (3 available) [6,0s]
    • iPhone de x (wireless) (mobile) • 00008101-0014796014F8001E • ios            • iOS 17.7.1 21H216
    • macOS (desktop)                       • macos                     • darwin-arm64   • macOS 14.7.7 23H723 darwin-arm64
    • Chrome (web)                          • chrome                    • web-javascript • Google Chrome 140.0.7339.132

[✓] Network resources [498ms]
    • 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 lista: animationAnimation APIsc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has 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

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions