style method
Implementation
TextStyle style(BuildContext context) {
if (textStyle != null) return textStyle!;
final sizeStyle = switch (size) {
LedgerButtonSize.xtraLarge => context.buttonMedium.bold,
LedgerButtonSize.large => context.buttonMedium.bold,
_ => context.buttonSmall.bold,
};
final typeStyle = switch (_type) {
_LedgerButtonType.primary1 =>
sizeStyle.copyWith(color: foregroundColor ?? context.intactWhite),
_LedgerButtonType.primary2 =>
sizeStyle.copyWith(color: foregroundColor ?? context.baseWhite),
_LedgerButtonType.secondary =>
sizeStyle.copyWith(color: foregroundColor ?? context.baseBlack),
_LedgerButtonType.tertiary1 =>
sizeStyle.copyWith(color: foregroundColor ?? context.primary.shade500),
_LedgerButtonType.tertiary2 =>
sizeStyle.copyWith(color: foregroundColor ?? context.baseBlack),
_LedgerButtonType.ghost =>
sizeStyle.copyWith(color: foregroundColor ?? context.baseBlack),
};
return typeStyle;
}