adaptiveElevationShadowsBack property

FlexAdaptive? adaptiveElevationShadowsBack
final

Controls shadow usage on elevated surfaces in Material 3 theming.

Material 3 removes elevation shadows on some elevated surfaces. With this property you can bring it back.

See class FlexAdaptive on how to configure the platform adaptive behavior. You may for example like the FlexAdaptive.iOSAndDesktop for a configuration that only keeps elevation tint on Material 3 themes on Android and Fuchsia platforms, and when the app is run in a web browser on these platforms.

The adaptiveElevationShadowsBack property has no impact in M2 mode. It only impacts component themes in FlexColorScheme where Flutter SDK also support adding elevation shadows back in M3 mode. Currently this applies to:

These components already have shadows in M3:

  • BottomNavigationBar, has shadow in M3 and no tint, is an M2 style only Widget.
  • BottomSheet,
  • Card
  • Chip
  • DropDownMenu
  • MenuAnchor
  • MenuBar, might be a mistake that the bar has shadow in M3 by default. The menus from the bar should have shadow and do, but probably not the menu bar itself. In designs in M3 web guide, the bar is not elevated.
  • NavigationRail, has shadow in M3 if elevated, probably should not, since this is a combined M2/M3 widget like most widgets are. Also does not have elevation tint in Flutter 3.7, probably should have when elevated. Default M3 design calls for it not being elevated, so the spec does not offer any final word on it.
  • PopupMenuButton, all menus have shadows in M3 design too.

If not defined, defaults to FlexAdaptive.off.

Implementation

final FlexAdaptive? adaptiveElevationShadowsBack;