collection method

CollectionReference<Map<String, dynamic>> collection({
  1. bool forTesting = false,
})

Gets a collection reference from Firestore.

Parameters:

  • forTesting: When true, uses FakeFirebaseFirestore for testing. Defaults to false.

Returns a CollectionReference that can be used to perform CRUD operations.

Implementation

CollectionReference<Map<String, dynamic>> collection(
    {bool forTesting = false}) {
  if (forTesting) {
    return _fakeFirestore.collection(this);
  } else {
    return FirebaseFirestore.instance.collection(this);
  }
}