getIconSize static method

double getIconSize(
  1. BuildContext context,
  2. OudsButtonLayout layout
)

Static method to get the icon size based on button layout.

Implementation

static double getIconSize(BuildContext context, OudsButtonLayout layout) {
  final buttonToken = OudsTheme.of(context).componentsTokens(context).button;
  switch (layout) {
    case OudsButtonLayout.iconOnly:
      return buttonToken.sizeIconOnly;
    case OudsButtonLayout.iconAndText:
      return buttonToken.sizeIcon;
    case OudsButtonLayout.textOnly:
      // TODO: Handle this case.
      throw UnimplementedError();
  }
}