toFirestore abstract method

Map<String, Object?> toFirestore(
  1. T value,
  2. SetOptions? options
)

Called by the SDK to convert value into the map that is written. options are the SetOptions of the write, or null (for example for add).

The map can hold any value Firestore stores, including FieldValue sentinels. With a merge option you can return only the fields to merge.

Implementation

Map<String, Object?> toFirestore(T value, SetOptions? options);