getFocusElevation method Null safety
- MaterialButton button
The button
's elevation when it is enabled and has focus.
Returns the button's MaterialButton.focusElevation if it is non-null.
If button is a FlatButton then the focus elevation is 0.0, otherwise the highlight elevation is 4.0.
Implementation
double getFocusElevation(MaterialButton button) {
if (button.focusElevation != null)
return button.focusElevation!;
if (button is FlatButton)
return 0.0;
return 4.0;
}