Closed rydmike closed 1 year ago
Hello @rydmike. Thank you for the detailed bug report. I can reproduce this issue on Master (3.7.0-15.0.pre.16)
using the code sample provided.
flutter doctor -v
(Master)The recent fix (https://github.com/flutter/flutter/pull/119819) was reverted in https://github.com/flutter/flutter/pull/120492.
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.
BottomAppBar Gets a Drop Shadow in M3
Based on the Material 3 specification the
BottomAppBar
should not have a drop shadow in Material 3 design. See specification https://m3.material.io/components/bottom-app-bar/specs.The current Flutter M3 implementation creates a default
BottomAppBar
in Material 3 mode that has a drop shadow.Expected results
Expected no
Material
drop shadow on defaultBottomAppBar
in Material 3 mode.Actual results
We get a default
BottomAppBar
in Material 3 mode withMaterial
drop shadow.Proposal
The recently revised
Material
requires settingshadowColor
toColors.transparent
to remove the default drop shadow in Material 3 mode. This is missing in current implementation, most likely forgotten to be added to this widget and theme when the change inMaterial
M3 behavior was made.The current default
BottomAppBarTheme
is:The
BottomAppBarTheme
, likeAppBarTheme
needs to have ashadowColor
property that is set toColors.transparent
and then used by underlyingMaterial
to remove the shadow.Issue demo code
Code sample
```dart // MIT License // // Copyright (c) 2023 Mike Rydstrom // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import 'package:flutter/material.dart'; enum ThemeType { defaultFactory, themeDataFrom, themeDataColorSchemeSeed, } // A seed color for M3 ColorScheme. const Color seedColor = Color(0xff386a20); // Example themes ThemeData demoTheme(Brightness mode, bool useMaterial3, ThemeType type) { // Make an M3 ColorScheme.from seed final ColorScheme scheme = ColorScheme.fromSeed( brightness: mode, seedColor: seedColor, ); switch (type) { case ThemeType.defaultFactory: return ThemeData( colorScheme: scheme, useMaterial3: useMaterial3, ); case ThemeType.themeDataFrom: return ThemeData.from( colorScheme: scheme, useMaterial3: useMaterial3, ); case ThemeType.themeDataColorSchemeSeed: return ThemeData( brightness: mode, colorSchemeSeed: seedColor, useMaterial3: useMaterial3, ); } } void main() { runApp(const IssueDemoApp()); } class IssueDemoApp extends StatefulWidget { const IssueDemoApp({super.key}); @override StateUsed Flutter Version
Channel master, 3.7.0-15.0.pre.16
Flutter doctor
``` [!] Flutter (Channel master, 3.7.0-15.0.pre.16, on macOS 13.0.1 22A400 darwin-arm64, locale en-US) • Flutter version 3.7.0-15.0.pre.16 on channel master at • Upstream repository https://github.com/flutter/flutter.git • Framework revision 7ddf42eae5 (20 hours ago), 2023-01-06 17:44:44 -0500 • Engine revision 33d7f8a1b3 • Dart version 3.0.0 (build 3.0.0-85.0.dev) • DevTools version 2.20.0 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/rydmike/Library/Android/sdk • Platform android-33, build-tools 33.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.3) • 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 11.0.13+0-b1751.21-8125866) [✓] IntelliJ IDEA Community Edition (version 2022.3.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 71.2.6 • Dart plugin version 223.8214.16 [✓] VS Code (version 1.73.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.54.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.0.1 22A400 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124 [✓] HTTP Host Availability • All required HTTP hosts are available ```