Key.fromParent constructor

Key.fromParent(
  1. String kind,
  2. int id, {
  3. Key? parent,
})

Implementation

factory Key.fromParent(String kind, int id, {Key? parent}) {
  var partition = Partition.DEFAULT;
  var elements = <KeyElement>[];
  if (parent != null) {
    partition = parent.partition;
    elements.addAll(parent.elements);
  }
  elements.add(KeyElement(kind, id));
  return Key(elements, partition: partition);
}