replace method
Replace.
Implementation
@override
void replace(String id, NmDialPlan record, NmTelecomL10n l10n) {
final index = _records.indexWhere((item) => item.id == id);
if (index < 0) throw NmPlanRepositoryException(l10n.planErrNotFound(id));
if (record.id != id) {
throw NmPlanRepositoryException(l10n.planErrIdImmutable);
}
final next = List<NmDialPlan>.of(_records);
next[index] = record;
_records = next;
}