exportHistory method

String exportHistory({
  1. DateTime? since,
  2. String format = 'json',
})

Exports notification history as JSON or CSV.

Implementation

String exportHistory({DateTime? since, String format = 'json'}) {
  final filtered = since != null
      ? _notifications.where((n) => n.timestamp.isAfter(since)).toList()
      : List<AppNotification>.from(_notifications);

  if (format == 'csv') {
    return _exportCsv(filtered);
  }
  return _exportJson(filtered);
}