shape property

ShapeBorder shape

The shape of a button's material.

The button's highlight and splash are clipped to this shape. If the button has an elevation, then its drop shadow is defined by this shape as well.

Defaults to a rounded rectangle with circular corner radii of 4.0 if textTheme is ButtonTextTheme.primary, a rounded rectangle with circular corner radii of 2.0 otherwise.

See also:

Implementation

ShapeBorder get shape {
  return _shape ?? switch (textTheme) {
    ButtonTextTheme.normal || ButtonTextTheme.accent =>
      const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))),
    ButtonTextTheme.primary =>
      const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))),
  };
}