shape property

ShapeBorder? shape
final

The shape of the app bar's Material as well as its shadow.

If this property is null, then AppBarTheme.shape of ThemeData.appBarTheme is used. Both properties default to null. If both properties are null then the shape of the app bar's Material is just a simple rectangle.

A shadow is only displayed if the elevation is greater than zero.

This sample demonstrates how to implement a custom app bar shape for the shape property.
link

To create a local project with this code sample, run:
flutter create --sample=material.AppBar.shape.1 mysample

See also:

  • elevation, which defines the size of the shadow below the app bar.
  • shadowColor, which is the color of the shadow below the app bar.

Implementation

final ShapeBorder? shape;