eventLogFamily top-level property

AutoDisposeProviderFamily<AsyncValue<EventLog>, int> eventLogFamily
final

Provider family that returns an EventLog for the given device ID.

The event log will contain serial number information as well as the active alerts and timeline.

Implementation

final eventLogFamily = Provider.autoDispose.family<AsyncValue<EventLog>, int>(
  (ref, int id) {
    final currentDateTime = ref.watch(currentDateTimeProvider);

    final details = ref.watch(deviceDetailsApiFamily(id));
    final alerts = ref.watch(alertsApiFamily(id));
    final events = ref.watch(eventsApiFamily(id));

    return mergeAsyncValues3(
      details,
      alerts,
      events,
      (details, alerts, events) =>
          dtoToEventLog(currentDateTime(), details, alerts, events),
    );
  },
);