getPadding static method

EdgeInsets getPadding(
  1. BuildContext context,
  2. OudsButtonLayout layout
)

Implementation

static EdgeInsets getPadding(BuildContext context, OudsButtonLayout layout) {
  final theme = OudsTheme.of(context);
  switch (layout) {
    case OudsButtonLayout.iconOnly:
      return EdgeInsets.all(theme.componentsTokens.button.spaceInsetIconOnly);
    case OudsButtonLayout.iconAndText:
      return EdgeInsets.only(
        top: theme.componentsTokens.button.spacePaddingBlock,
        right: theme.componentsTokens.button.spacePaddingInlineEndIconStart,
        bottom: theme.componentsTokens.button.spacePaddingBlock,
        left: theme.componentsTokens.button.spacePaddingInlineIconStart,
      );
    case OudsButtonLayout.textOnly:
      return EdgeInsets.only(
        top: theme.componentsTokens.button.spacePaddingBlock,
        right: theme.componentsTokens.button.spacePaddingInlineIconNone,
        bottom: theme.componentsTokens.button.spacePaddingBlock,
        left: theme.componentsTokens.button.spacePaddingInlineIconNone,
      );
  }
}