Repository navigation
Material elevation shadow not display correctly, when the page is long or scroll down #59424
Copy link
Copy link
Closed
Labels
f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6Found to occur in 3.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packages
Description
Normal case, if the page no need to scroll.

After scroll down, or the page is long (added a box in tail)
Material shadow not display correctly.

Code below:
Material(
elevation: 20,
shadowColor: Theme.of(context).primaryColor,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Form(
autovalidate: true,
key: _formKey,
child: Column(
children: [
PhoneNumberWidget(controller: _phoneController),
PasswordWidget(controller: _passwordController),
],
),
),
),
),Added this to make page longer, for testing the shadow
Padding(
padding: const EdgeInsets.all(100),
child: Container(),
),[✓] Flutter (Channel beta, 1.19.0-4.1.pre, on Mac OS X 10.15.5 19F101, locale en-GB)
• Flutter version 1.19.0-4.1.pre at /Users/peterlau/Documents/Git/flutter
• Framework revision f994b76974 (5 days ago), 2020-06-09 15:53:13 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[!] 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).
[✓] VS Code (version 1.45.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (1 available)
• iPhone SE (2nd generation) • B680C4ED-2753-4182-8253-CF944A9EB265 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6Found to occur in 3.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packages
Activity
iapicca commentedon Jun 15, 2020
Hi @peterlau0010
I believe the issue might depend from
Paddingif your intent is to increase the size vertically
try to replace
EdgeInsets.all(...)withEdgeInsets.symmetric(vertical: ...);if the issue persist please provide a complete reproducible minimal code sample
Thank you
peterlau0010 commentedon Jun 17, 2020
Hi @iapicca ,
Below is the sample code to reproduce the problem:
I found that the problem should be inside Listview, and using padding argument..
Don't whether I am using in a wrong way, or it is a bug..
peterlau0010 commentedon Jun 24, 2020
any update for this issue?
TahaTesser commentedon Jun 25, 2020
Code Sample
flutter doctor -v
xu-baolin commentedon Aug 4, 2020
I am currently investigating this issue.
xu-baolin commentedon Aug 6, 2020
@liyuqian Hi, this issue is because when overflow, the shadow was be cut by clipRect(the shadow with an offset at the same layer and overflow too). Via #59364 you said all of the widget's clipBehavior will change to
Clip.none. So this problem will disappear in time, is that right?In addition, do these widgets(such as List, PageView, etc..) need to expose the clipBehavior interface for developers to control?
5 remaining items
Add clipBehavior to ListView, GridView, PageView (flutter#63147)
TahaTesser commentedon Oct 13, 2020
Issue persists
complete code sample
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.7 19H2, locale en-GB) • Flutter version 1.22.1 at /Users/tahatesser/Code/flutter_stable • Framework revision f30b7f4db9 (5 days ago), 2020-10-08 10:06:30 -0700 • Engine revision 75bef9f6c8 • Dart version 2.10.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.0.1, Build version 12A7300 • CocoaPods version 1.10.0.rc.1 [!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.0 [✓] Connected device (1 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) ! Doctor found issues in 1 category.flutter doctor -v
[✓] Flutter (Channel master, 1.23.0-14.0.pre.152, on Mac OS X 10.15.7 19H2 x86_64, locale en-GB) • Flutter version 1.23.0-14.0.pre.152 at /Users/tahatesser/Code/flutter_master • Framework revision 62cf4dbf10 (4 hours ago), 2020-10-13 14:12:02 +0800 • Engine revision 6634406889 • Dart version 2.11.0 (build 2.11.0-213.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/tahatesser/Code/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/tahatesser/Code/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.0.1, Build version 12A7300 • CocoaPods version 1.10.0.rc.1 [✓] Android Studio (version 4.1) • 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 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.50.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.15.0 [✓] Connected device (1 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 10 (API 29) • No issues found!nfortiz commentedon Oct 29, 2020
@Ahmadre I don't think so, I have the same problem but I dont use SafeArea.
maheshj01 commentedon Nov 30, 2022
I can still reproduce the issue on the latest stable and master channel.
flutter doctor -v
flutter doctor -v (mac)
Piinks commentedon Mar 21, 2023
I believe this is fixed by using the
clipBehavioron the scroll view and setting it toClip.none.The default clip behavior is
Clip.hardEdgewhich is why the shadow is cut off.I am closing this as fixed, but if not please do let us know so we can reopen this and take another look! Thank you!
github-actions commentedon Apr 4, 2023
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 -vand a minimal reproduction of the issue.