'How to map sub collection to json_serializable nested class?

json_serializable supports nested classes:

https://docs.flutter.dev/development/data-and-backend/json#generating-code-for-nested-classes

My goal is to have a Parent class with a Child member, and I want the firestore to look like:

Collection(Parent) -> {parentId} -> Collection(Child) -> {childId}

What is not clear is how the firestore that backs this model is supposed to be structured and accessed.

Any ideas? Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source