updateEntry method

void updateEntry(
  1. int id,
  2. void update(
    1. HttpLogEntry entry
    )
)

Implementation

void updateEntry(int id, void Function(HttpLogEntry entry) update) {
  final entry = findById(id);
  if (entry != null) {
    final wasPending = entry.status == HttpLogStatus.pending;
    update(entry);
    if (wasPending && entry.status != HttpLogStatus.pending) {
      onEntryCompleted?.call(entry);
    }
    notifyListeners();
  }
}