Skip to content

BottomAppBar: Elevation effect (shadow) doubled in Material 3 #123064

@chrisbobbe

Description

@chrisbobbe

Steps to Reproduce

  1. Copy code sample below to main.dart in a new flutter create app
  2. Look at the bottom app bar's shadow color (I've made this easy by setting the bottom app bar's color to transparent)

Expected results: The shadow should be the correct color for shadowColor: Colors.black.

Actual results: The shadow is too dark.

Expected Actual
image image
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: Theme.of(context).copyWith(useMaterial3: true), // (Does not reproduce with Material 2)
      home: const Scaffold(
        bottomNavigationBar: BottomAppBar(
          shadowColor: Colors.black,
          color: Colors.transparent, // (Just to help make the shadow visible)
        ),
      ),
    );
  }
}
Logs

(No errors expected or observed in the logs.)

$ flutter analyze
Analyzing scratch...                                                    
No issues found! (ran in 1.8s)
$ flutter doctor -v
[✓] Flutter (Channel main, 3.9.0-12.0.pre.11, on macOS 13.0 22A380 darwin-x64, locale en-US)
    • Flutter version 3.9.0-12.0.pre.11 on channel main at /Users/chrisbobbe/.local/lib/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2312097731 (2 hours ago), 2023-03-20 13:11:07 -0700
    • Engine revision 7194b751f1
    • Dart version 3.0.0 (build 3.0.0-339.0.dev)
    • DevTools version 2.22.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/chrisbobbe/Library/Android/sdk
    • Platform android-33, build-tools 30.0.3
    • ANDROID_HOME = /Users/chrisbobbe/Library/Android/sdk
    • 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)

[✓] VS Code (version 1.76.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • Chris’s iPhone (mobile) • 00008110-000924383632801E            • ios            • iOS 16.1 20B82
    • iPhone 14 Pro (mobile)  • B10DA4B8-480B-4FE1-A651-4DFBE39ABF71 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)         • macos                                • darwin-x64     • macOS 13.0 22A380 darwin-x64
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 111.0.5563.64
    ! Error: Chris’s Apple Watch needs to connect to determine its availability. Check the connection between the
      device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to
      be restarted and unlocked. (code 1)

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

• No issues found!

(Diagnosis and more discussion coming soon, and I plan to send a PR.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: material designflutter/packages/flutter/material repository.found in release: 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions