FirestorePublishLoader class

A LivePublishLoader on Cloud Firestore: the publish model is the document PublishSource.modelPath (publish/{projectId}; publish_preview/... for the editor's preview), each layout PublishSource.layoutPath (.../layouts/{layoutId}), each component PublishSource.componentPath (.../components/{type}). watchModel follows the model document: a republished component changes its entry there.

The project is projectId, else the one auth grants access to: the app's project token (CodelesslyConfig.authToken) resolves to its project through the Codelessly backend (FirebaseProjectAuth), whose claim the security rules of the publish paths check. auth authenticates before the first read. A template project (its access says so) reads PublishSource.template whatever source is asked.

A document not in the current format fails with a PublishLoadException saying so.

Implemented types

Constructors

FirestorePublishLoader(FirebaseFirestore firestore, {String? projectId, ProjectAuth? auth})

Properties

auth → ProjectAuth?
Authenticates the app with its project (and names it).
final
firestore → FirebaseFirestore
final
hashCode → int
The hash code for this object.
no setterinherited
projectId → String?
The project, when known up front; else auth's.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

loadComponent(PublishSource source, String type) → Future<PublishComponent>
Component type (a type name the model's components lists): the definition stored at PublishSource.componentPath. Throws a PublishLoadException when there is none.
override
loadLayout(PublishSource source, String layoutId) → Future<PublishLayout>
Layout layoutId (a layout id the model lists).
override
loadModel(PublishSource source) → Future<PublishModel>
The project's publish model.
override
loadPlugin(String id, int version) → Future<PluginVersion?>
The document plugins/{id}/versions/{n}; null when there is none.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
watchModel(PublishSource source) → Stream<PublishModel>
The project's publish model, now and on every change.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited