Skip to content

[Impeller] ImageFiltered flickers when widget is rendered on top #139294

@jamesblasco

Description

@jamesblasco

Is there an existing issue for this?

Steps to reproduce

  1. Add an ImageFiltered
  2. Add a widget on top of it (eg: in a stack) and move it around

Expected results

  • The ImageFiltered should render as normal and not be affected by the widget on top
  • This happens correctly on Android but not on iOS using Impeller
  • This issue has been detected in stable 3.16.1 and latest master 3.17.0-18.0.pre.60

Actual results

  • Weird glitches when the widget on top moves. This happens only on iOS using Impeller

Code sample

Code sample
import 'dart:ui';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: MyHomePage());
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double y = 400;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Center(
            child: ImageFiltered(
              imageFilter: ImageFilter.dilate(radiusX: 100, radiusY: 100),
              child: Container(
                height: 200,
                color: Colors.green,
                margin: const EdgeInsets.all(24),
              ),
            ),
          ),
          Positioned(
            left: 0,
            right: 0,
            top: y,
            height: 24,
            child: GestureDetector(
              onHorizontalDragUpdate: (details) {
                setState(() {
                  y = details.globalPosition.dy;
                });
              },
              child: Container(
                color: Colors.black,
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-11-30.at.11.57.04.mp4

Logs

Logs

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.1, on macOS 14.1.1 23B81 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.84.2)
[✓] Connected device (3 available)
[✓] Network resources

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: 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