DBModel constructor

DBModel({
  1. DocumentReference<Object?>? ref,
})

A FirebaseRepository will return models of this type once data is retrieved from the DB.

Write a subclass with the attributes that you need to be stored in this DBModel from the Firestore. Implement FirebaseRepository.fromSnapshot and FirebaseRepository.toMap to convert a DocumentSnapshot to a DBModel of the required type and to convert a DBModel to a Map that can be stored in Firestore.

A simple implementation can be seen in the documentation of DBModel.clone

Implementation

DBModel({this.ref});