Document<T> constructor
Document<T> (
- String parent,
- String id, {
- FromJson<
T> ? fromJson, - ToJson<
T> ? toJson, - DependenciesBuilder<
T> ? dependenciesBuilder, - PersistorSettings? persistorSettings,
Implementation
Document(
this.parent,
this.id, {
this.fromJson,
this.toJson,
this.dependenciesBuilder,
PersistorSettings? persistorSettings,
}) {
this.persistorSettings = switch (persistorSettings) {
PathPersistorSettings _ => persistorSettings,
// If the persistor settings are not yet associated with a path, then the settings
// are updated to having been applied at the document's path.
PersistorSettings _ =>
PathPersistorSettings(settings: persistorSettings, ref: this),
_ => persistorSettings,
};
}