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