deleteById method

void deleteById(
  1. int id
)

Deletes by id — indexes shift when the list changes.

Implementation

void deleteById(int id) {
  final removed = _requests.indexWhere((r) => r.id == id);
  if (removed == -1) return;
  _requests.removeAt(removed);
  notifyListeners();
}