padding property Null safety

EdgeInsetsGeometry padding

Padding for a button's child (typically the button's label).

Defaults to 24.0 on the left and right if textTheme is ButtonTextTheme.primary, 16.0 on the left and right otherwise.

See also:

  • getPadding, which is used to calculate padding for the button's child (typically the button's label).

Implementation

EdgeInsetsGeometry get padding {
  if (_padding != null) {
    return _padding!;
  }
  switch (textTheme) {
    case ButtonTextTheme.normal:
    case ButtonTextTheme.accent:
      return const EdgeInsets.symmetric(horizontal: 16.0);
    case ButtonTextTheme.primary:
      return const EdgeInsets.symmetric(horizontal: 24.0);
  }
}