getButtonTextStyle static method

TextStyle getButtonTextStyle(
  1. bool isSelected,
  2. bool isEnabled
)

Obtiene el estilo de texto para un botón según su estado.

Este método devuelve un TextStyle dependiendo de si el botón está habilitado y si está seleccionado. Los estilos varían en color para reflejar el estado actual.

Características:

  • Si el botón está deshabilitado (isEnabled == false), el texto se muestra con opacidad.
  • Si el botón está habilitado y seleccionado (isSelected == true), el color del texto es violeta claro.
  • Si el botón está habilitado pero no seleccionado, el color del texto es morado oscuro.

Parámetros:

  • isSelected (bool): Indica si el botón está seleccionado.
  • isEnabled (bool): Indica si el botón está habilitado.

Retorna:

  • Un objeto TextStyle con el tamaño de fuente, peso y color correspondientes.

Implementation

static TextStyle getButtonTextStyle(bool isSelected, bool isEnabled) {
  if (!isEnabled) {
    // SI NO HAY TIEMPO ACTUAL, SE PONE CON OPACIDAD
    return disabled;
  } // SI EL USUARIO TODAVIA NO HA HECHO NINGUN TIEMPO

  // SI ESTA SELECCIONADO, SE CAMBIA A VIOLETA Y SI NO ESTA SELECCIONADO
  // PERO HAY UN TIEMPO ACTUAL, SE PONE EN MORADO
  return TextStyle(
    fontSize: 20,
    fontWeight: FontWeight.bold,
    color:
        isSelected ? AppColors.lightVioletColor : AppColors.darkPurpleColor,
  );
}