Skip to content

BackdropFilter with ClipRRect leaks blur outside rounded corners when UiKitView is present (iOS) #175048

Closed

Description

@SeeyouYsen

Steps to reproduce

Description

When using BackdropFilter with ClipRRect to create a rounded blur effect,
the blur unexpectedly leaks outside the clipped rounded corners only when a UiKitView is present in the widget tree.

This works correctly if no UiKitView is used, so the issue seems to be related to Flutter’s platform view rendering on iOS.

Steps to Reproduce

  1. Create a Flutter project.
  2. Add a custom UiKitView (using FlutterPlatformViewFactory).
  3. Overlay a BackdropFilter with ClipRRect.

Expected results

The blur should be clipped perfectly to the rounded rectangle, with no artifacts outside the corners.

Actual results

On iOS, when a UiKitView exists, the blur leaks outside the rounded corners (see screenshot).

Code sample

Code sample
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)

    // Register the platform view factory
    let registrar = self.registrar(forPlugin: "MyUiKitViewPlugin")
    let factory = MyUiKitViewFactory(messenger: registrar!.messenger())
    registrar!.register(factory, withId: "my-view-type")

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

class MyUiKitViewFactory: NSObject, FlutterPlatformViewFactory {
  private var messenger: FlutterBinaryMessenger

  init(messenger: FlutterBinaryMessenger) {
    self.messenger = messenger
    super.init()
  }

  func create(
    withFrame frame: CGRect,
    viewIdentifier viewId: Int64,
    arguments args: Any?
  ) -> FlutterPlatformView {
    return MyUiKitView(
      frame: frame,
      viewIdentifier: viewId,
      arguments: args,
      binaryMessenger: messenger
    )
  }

  func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
    return FlutterStandardMessageCodec.sharedInstance()
  }
}

class MyUiKitView: NSObject, FlutterPlatformView {
  private var _view: UIView

  init(
    frame: CGRect,
    viewIdentifier viewId: Int64,
    arguments args: Any?,
    binaryMessenger messenger: FlutterBinaryMessenger?
  ) {
    _view = UIView()
    super.init()
  }

  func view() -> UIView {
    return _view
  }
}
void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Stack(
          fit: StackFit.expand,
          children: [
            
            Image.asset(
              'assets/img.png',
              fit: BoxFit.cover,
            ),
            UiKitView(viewType: 'my-view-type'),
            Positioned(
              top: 100,
              left: 40,
              child: ClipRRect(
                borderRadius: BorderRadius.circular(80),
                child: BackdropFilter(
                  filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
                  child: Container(
                    height: 200,
                    width: 300,
                    color: Colors.white.withOpacity(0.2),
                  ),
                ),
              )),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

Logs

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.2, on macOS 15.6.1 24G90 darwin-arm64, locale
    zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version
    36.0.0-rc4)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.103.2)
[✓] Connected device (5 available)

Activity

  1. wwmz commented on Sep 8, 2025

    @wwmz
  2. tirth-patel-nc commented on Sep 8, 2025

    @tirth-patel-nc
    Member

    @SeeyouYsen Thanks for the report. Seeing the same behaviour with latest SDK versions on iOS. check the mouse pointer for the leak.

    stable : 3.35.3
    master : 3.36.0-1.0.pre-448
    
    Image

    #99691, #89585 might be related

  3. added
    platform-iosiOS applications specifically
    team-iosOwned by iOS platform team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    c: renderingUI glitches reported at the engine/skia or impeller rendering level
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Sep 8, 2025
  4. wwmz commented on Sep 9, 2025

    @wwmz

    Solved by using native UIBlurEffect

  5. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Sep 18, 2025
  6. timcreatedit commented on Oct 10, 2025

    @timcreatedit
    Contributor

    @tirth-patel-nc is workaround-available really valid here? BackdropFilter can be much more than blur

  7. timcreatedit commented on Oct 10, 2025

    @timcreatedit
    Contributor

    People are reporting this in my repository as well: whynotmake-it/flutter_liquid_glass#64

  8. Hari-07 commented on Jan 28, 2026

    @Hari-07
    Member

    Isn't this the same issue as #115926 ? In which case there's a fix thats been merged in already

  9. jmagman commented on Jan 28, 2026

    @jmagman
    Member

    Thank you @Hari-07! That fix is available in beta 3.41.0-0.0.pre, @SeeyouYsen or @timcreatedit can you confirm?

  10. github-actions commented on Feb 12, 2026

    @github-actions

    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.

  11. locked as resolved and limited conversation to collaborators on Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: renderingUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.found in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.has 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-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions