get method

Future<List<T>> get()

Executes the query and returns the results as a list of model objects.

Implementation

Future<List<T>> get() async {
  try {
    QuerySnapshot querySnapshot = await state.get();
    return querySnapshot.docs
        .map((doc) => _fromJson(doc.data() as Map<String, dynamic>))
        .toList();
  } catch (e) {
    debugPrint("[[Error executing Firestore query]]: $e");
    return [];
  }
}