DBModel class abstract

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

Implemented types

Constructors

DBModel({DocumentReference<Object?>? ref})
A FirebaseRepository will return models of this type once data is retrieved from the DB.

Properties

hashCode int
The hash code for this object.
no setterinherited
id String?
Generate a id for the DBModel. Internally this will generate an ID for newly created documents.
no setteroverride
ref ↔ DocumentReference<Object?>?
Store the DocumentReference of this DBModel which will represent a document in Firestore. All DBModel which is return from FirebaseRepository.fromSnapshot should have a ref.
getter/setter pairoverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clone() DBModel
Should return a copy of DBModel. This method is not use by any of the classes in this library. So, implement this method if you see the need.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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