🐛 [cloud_firestore] Future collection converter #17237
Labels
Needs Attention
This issue needs maintainer attention.
plugin: cloud_firestore
type: enhancement
New feature or request
Collection converters support for
Future
I want to request that
withConverter
supports aFuture
for itsfromFirestore
argument.Use case
In some cases, like mine, one entity/data object has another one embedded.
Imagine a collection
users
and a collectionevents
. Documents in collectionevents
have one reference to a document inusers
.In my Flutter app, there is class
User
and a classEvent
. ClassEvent
has a memberuser
that holds aUser
object.User
does havefromFirebase
constructor andtoFirebase
method.Event
has atoFirebase
method but cannot have afromFirebase
constructor: instantiating anEvent
class requires not only retrieving data fromevents
collection, but also awaiting to resolve a document fromusers
collection once I got the document fromevents
and have access to its associateduser
.If I could use a
Future
factory function to construct myEvent
object, I would be able to usefromFirebase
and leverage type safe conversions.Hope to have explained myself and my use case, and even though I don't think this will be implemented, I just wanted to say that it would be really useful :)
The text was updated successfully, but these errors were encountered: