loading static method

ButtonState loading({
  1. Color color = Colors.lightBlue,
  2. Widget? child,
})

Estado de carga predefinido.

Muestra un CircularProgressIndicator animado en color azul claro.

Ejemplo:

final loadingState = ButtonState.loading();
// o personalizado:
final customLoading = ButtonState.loading(
  color: Colors.blue,
  child: SizedBox(
    width: 20,
    height: 20,
    child: CircularProgressIndicator(strokeWidth: 2),
  ),
);

Implementation

static ButtonState loading({
  Color color = Colors.lightBlue,
  Widget? child,
}) => ButtonState(
  id: 'loading',
  color: color,
  child:
      child ??
      const SizedBox(
        width: 22,
        height: 22,
        child: CircularProgressIndicator(
          strokeWidth: 3,
          color: Colors.white,
        ),
      ),
  isCompact: true,
);