fromFirestore function

Object? fromFirestore(
  1. Object? value
)

Firestore values as the SDK's: timestamps as UTC DateTimes, blobs as bytes, references as their path, geo points as {latitude, longitude}.

Implementation

Object? fromFirestore(Object? value) => switch (value) {
      Timestamp() => value.toDate().toUtc(),
      Blob() => value.bytes,
      DocumentReference() => value.path,
      GeoPoint() => {'latitude': value.latitude, 'longitude': value.longitude},
      List() => [for (final v in value) fromFirestore(v)],
      Map() => {for (final e in value.entries) '${e.key}': fromFirestore(e.value)},
      _ => value,
    };