uploadOnCollectionLevel method

Future<void> uploadOnCollectionLevel(
  1. String collectionPath,
  2. String id,
  3. Map<String, dynamic> payload,
  4. dynamic successful,
  5. dynamic failed,
)

upload will be different types... upload to a collection level

Implementation

Future<void> uploadOnCollectionLevel(String collectionPath, String id,
    Map<String, dynamic> payload, successful, failed) async {
  Constants.fireStoreInstance
      .collection(collectionPath)
      .doc(id)
      .set(payload)
      .then((value) => successful())
      .onError((error, stackTrace) => failed(error))
      .timeout(const Duration(seconds: 30));
}