buildButtonStyle static method

ButtonStyle buildButtonStyle(
  1. TWidgetTheme baseTheme,
  2. TButtonShape shape,
  3. TButtonSize size
)

Implementation

static ButtonStyle buildButtonStyle(TWidgetTheme baseTheme, TButtonShape shape, TButtonSize size) {
  final padding = switch (shape) {
    TButtonShape.tile => size.tilePaddingState,
    _ => size.paddingState,
  };

  return ButtonStyle(
    backgroundColor: baseTheme.backgroundState,
    foregroundColor: baseTheme.foregroundState,
    iconColor: baseTheme.foregroundState,
    side: baseTheme.borderSideState,
    padding: padding,
    minimumSize: size.minimumSizeState,
    visualDensity: VisualDensity.standard,
    overlayColor: WidgetStateProperty.all(Colors.transparent),
    elevation: WidgetStateProperty.all(0.0),
    textStyle: WidgetStateProperty.all(TextStyle(fontSize: size.font, fontWeight: baseTheme.type.fontWeight, letterSpacing: 0.65)),
    shape: WidgetStateProperty.all(shape.border),
  );
}