isNaturalId method

bool isNaturalId(
  1. String? id,
  2. String? type
)

Returns true when id was author-supplied (not auto-generated from type).

Implementation

bool isNaturalId(String? id, String? type) {
  if (id == null) return false;
  if (type == null) return true;
  return !id.contains(type);
}