withChild<Z extends DataClass> method
This method registers a DataSet that will have direct relation to the dataset already instantiated. For that, it uses a relation name as a key for retrieving it later
Implementation
DataSet<T> withChild<Z extends DataClass>(DataSet<Z> child,
[String identifier = 'default']) {
if (_children[Z] != null) {
if (_children[Z]!.containsKey(identifier)) {
throw Exception(
'Cannot insert two datasets of the type ${child.modelName} with the same identifier $identifier');
}
_children[Z]![identifier] = child;
} else {
_children[Z] = {identifier: child};
}
return this;
}