Skip to content

BottomAppBar: surfaceTintColor doc should say it only applies in Material 3 #124536

@chrisbobbe

Description

@chrisbobbe

Here's the full doc on BottomAppBar.surfaceTintColor currently:

  /// The color used as an overlay on [color] to indicate elevation.
  ///
  /// If this is null, no overlay will be applied. Otherwise the
  /// color will be composited on top of [color] with an opacity related
  /// to [elevation] and used to paint the background of the [BottomAppBar].
  ///
  /// The default is null.
  ///
  /// See [Material.surfaceTintColor] for more details on how this overlay is applied.
  final Color? surfaceTintColor;

It's very easy to confuse the Material 3 "surface tint" effect with the Material 2 "overlay" effect, but they are different. (See ElevationOverlay.applySurfaceTint and ElevationOverlay.applyOverlay.)

"Surface tint" isn't and shouldn't be applied when ThemeData.useMaterial3 is false. The linked Material.surfaceTintColor doc makes that clear, but I think it would help if BottomAppBar's doc mentioned it too. Perhaps with something like:

  /// A custom color for the Material 3 surface-tint elevation effect.
  ///
  /// In Material 3, a "surface tint" with an opacity related to [elevation]
  /// will be applied to the [BottomAppBar]'s background.
  /// Use this property to override the default color of that tint.
  ///
  /// If this property is null, then [BottomAppBarTheme.surfaceTintColor]
  /// of [ThemeData.bottomAppBarTheme] is used.
  /// If that is also null, [ColorScheme.surfaceTint] is used.
  ///
  /// Ignored if [ThemeData.useMaterial3] is false.
  ///
  /// The default is null.
  ///
  /// See [Material.surfaceTintColor] for more details on how this overlay is applied.
  final Color? surfaceTintColor;

Metadata

Metadata

Assignees

No one assigned

    Labels

    d: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: 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