notifyState method

void notifyState({
  1. String? descrip,
  2. required String detail,
})

Notifica un estado del servicio

Parámetros:

  • descrip - Descripción opcional del estado
  • detail - Detalle requerido del estado

La notificación se muestra en el sistema y se emite por el socket

Implementation

void notifyState({
  String? descrip,
  required String detail,
}) async {
  _notifyState ??=
      await createAndroidNotifyFn(descrip: descrip ?? name, persistent: true);
  await _notifyState!(descrip: descrip, detail: detail);
  console.log('detail $detail');
  io.emit('notifyState', {
    'descrip': descrip ?? name,
    'detail': detail,
    'active': active,
    'timestamp': DateTime.now().toIso8601String(),
  });
}