Skip to content

Get Document

Efra Espada edited this page Feb 22, 2024 · 1 revision

To retrieve the typed instance of a document, you can use the get method. It fetches the document's data from Firestore with the desired class:

Chat chat = await chatDocument.get();

For improved type safety, you can specify the expected type of document using:

final chat = await chatDocument.get<Chat>();