tagButtonStyle static method

ButtonStyle tagButtonStyle(
  1. BuildContext context
)

Button style for an ElevatedButton that matches the Kohler "tag" widget style usually used for status labels.

Implementation

static ButtonStyle tagButtonStyle(BuildContext context) {
  final isLight = context.theme.brightness.isLight;

  return ElevatedButton.styleFrom(
    backgroundColor: isLight
        ? context.colorScheme.primaryContainer
        : context.colorScheme.primary,
    foregroundColor: isLight
        ? context.colorScheme.onPrimaryContainer
        : context.colorScheme.onPrimary,
    textStyle: context.textTheme.labelSmall,
    padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 12.0),
    minimumSize: Size.zero,
    elevation: 0.0,
    shape: const StadiumBorder(),
  );
}