getDisabledElevation method Null safety

double getDisabledElevation(
  1. MaterialButton button
)

The button's elevation when MaterialButton.onPressed is null (when MaterialButton.enabled is false).

Returns the button's MaterialButton.elevation if it is non-null.

Otherwise the disabled elevation is 0.0.

Implementation

double getDisabledElevation(MaterialButton button) {
  if (button.disabledElevation != null)
    return button.disabledElevation!;
  return 0.0;
}