getIconSize static method
- BuildContext context,
- 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();
}
}