Skip to content

Overscroll effect isn't rendered properly when scrolling with backdrop filter blur on 3.16  #138940

@miphik

Description

@miphik

Is there an existing issue for this?

Steps to reproduce

  1. create a scrollable widget
  2. add a BackdropFilter with blur inside that scrollable widget

I believe the cause of this problem is in this PR

Expected results

Blur stays the same when stretched

Actual results

Blur halfway disappears when stretched

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 MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: const MyHomePage(title: 'Scrolling 3.16.0'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({
    super.key,
    required this.title,
  });

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBody: true,
      extendBodyBehindAppBar: true,
      body: Stack(
        children: [
          ListView.separated(
            itemCount: 1000,
            itemBuilder: (_, i) {
              if (i == 0) {
                return Stack(
                  children: [
                    Container(
                      width: MediaQuery.sizeOf(context).width,
                      height: 80,
                      margin: const EdgeInsets.only(top: 10),
                      color: Colors.black,
                    ),
                    SizedBox(
                      width: MediaQuery.sizeOf(context).width,
                      height: 100,
                      child: ClipRRect(
                        child: BackdropFilter(
                          filter: ImageFilter.blur(sigmaY: 12, sigmaX: 12),
                          child: AppBar(
                            backgroundColor: Colors.white.withOpacity(0.3),
                            title: Text(title),
                          ),
                        ),
                      ),
                    ),
                  ],
                );
              }
              return Container(
                clipBehavior: Clip.antiAlias,
                margin: const EdgeInsets.symmetric(horizontal: 16),
                decoration: BoxDecoration(
                  color: Colors.amberAccent,
                  borderRadius: BorderRadius.circular(16),
                ),
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    SizedBox(
                      height: 200,
                      width: MediaQuery.sizeOf(context).width,
                    ),
                    const SizedBox(height: 4),
                    Text('Some text for $i'),
                    const SizedBox(height: 4),
                  ],
                ),
              );
            },
            separatorBuilder: (_, __) => const SizedBox(height: 8),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Before 3.16 After 3.16
2023-11-23.12.55.14.mp4
2023-11-23.12.55.11.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1 23B74 darwin-arm64, locale en-DE)
    • Flutter version 3.16.0 on channel stable at /flutter
    • Upstream repository [email protected]:flutter/flutter.git
    • Framework revision db7ef5bf9f (8 days ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Android/sdk
    • Platform android-33, build-tools 30.0.3
    • ANDROID_HOME = /Android/sdk
    • Java binary at: Library/Java/JavaVirtualMachines/temurin-17.0.7/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.11.3

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

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 76.3.4
    • Dart plugin version 232.10248

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 14.1 23B74 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 119.0.6045.159

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

! Doctor found issues in 1 category. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: regressionIt was better in the past than it is nowf: scrollingViewports, list views, slivers, etc.found in release: 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions