FirebaseStore<T>.create constructor

FirebaseStore<T>.create({
  1. required FirebaseStore parent,
  2. required String path,
  3. required DataFromJsonCallback<T> onDataFromJson,
  4. required DataToJsonCallback<T> onDataToJson,
  5. required PatchDataCallback<T> onPatchData,
})

Constructs a store from a parent store and a sub path with callbacks.

The created store will use the same restApi as the parent, but append path to it's subPaths, meaning it will have a deeper virtual root as it's parent.

The callbacks are used to perform the serialization from and to JSON. onDataFromJson is used to convert a json value to T, onDataToJson does the other way around. onPatchData is used to process patch updates from the server and update instances of T.

Implementation

factory FirebaseStore.create({
  required FirebaseStore<dynamic> parent,
  required String path,
  required DataFromJsonCallback<T> onDataFromJson,
  required DataToJsonCallback<T> onDataToJson,
  required PatchDataCallback<T> onPatchData,
}) = CallbackFirebaseStore;