Consider exposing the __name__
reserved field in snapshot.data
(Firestore)
#3519
Unanswered
Jonas-Sander
asked this question in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to deserialize a dto in Dart from a
DocumentSnapshot
.What I want to write:
In this way I wouldn't have to either
String id
-Parameter where I passsnapshot.id
(fromData(Map<String, dynamic> data, {String id})
) orDocumentSnapshot snapshot
as the parameter infromData
instead ofMap<String, dynamic> data
(HomeworkDto.fromData(DocumentSnapshot snapshot)
).In my special case I am trying to get to the point where I can share DTOs between dart frontend and backend (WIP) which means that I don't want a dependency on cloud:firestore in my DTOs if possible.
I still think this would even benefit users not trying to share DTOs as this code is more concise instead of having to use the 2 ways mentioned above. I also can't really think of any cons.
Beta Was this translation helpful? Give feedback.
All reactions