removeNoPkRow method

void removeNoPkRow(
  1. Map<String, dynamic> rowJson, {
  2. String? requestId,
})

Implementation

void removeNoPkRow(Map<String, dynamic> rowJson, {String? requestId}) {
  if (hasPrimaryKey) return;
  if (requestId != null) {
    final i = _rows.indexWhere((e) => e.requestId == requestId);
    if (i >= 0) {
      _rows.removeAt(i);
      _refreshRowsNotifier();
    }
    return;
  }
  for (var i = 0; i < _rows.length; i++) {
    final asJson = decoder.toJson(_rows[i].row);
    if (asJson != null && _jsonEquals(asJson, rowJson)) {
      _rows.removeAt(i);
      _refreshRowsNotifier();
      return;
    }
  }
}