textButtonStyle function

ButtonStyle textButtonStyle(
  1. Palette sc, {
  2. TextStyle? textStyle,
  3. OutlinedBorder? shape,
  4. required double scale,
})

Text button with transparent background, no border.

Implementation

ButtonStyle textButtonStyle(
  Palette sc, {
  TextStyle? textStyle,
  OutlinedBorder? shape,
  required double scale,
}) {
  return ButtonStyle(
    animationDuration: buttonStyleAnimationDuration,
    visualDensity: VisualDensity.compact,
    backgroundColor: const WidgetStatePropertyAll(Colors.transparent),
    surfaceTintColor: const WidgetStatePropertyAll(Colors.transparent),
    overlayColor: const WidgetStatePropertyAll(Colors.transparent),
    foregroundColor: widgetPropertyByState(
      normal: () => sc.text,
      hover: () => sc.textHovered,
      splash: () => sc.textSplashed,
    ),
    iconColor: widgetPropertyByState(
      normal: () => sc.text,
      hover: () => sc.textHovered,
      splash: () => sc.textSplashed,
    ),
    textStyle: textStyle != null ? WidgetStatePropertyAll(textStyle) : null,
    minimumSize: WidgetStatePropertyAll(minimumSizeForScale(scale)),
    maximumSize: WidgetStatePropertyAll(maximumSize),
    padding: WidgetStatePropertyAll(padding),
    shape: shape == null ? null : WidgetStatePropertyAll(shape),
  );
}