logComment static method

Future<void> logComment(
  1. String type,
  2. String id,
  3. String recordId,
  4. String comment,
)

Implementation

static Future<void> logComment(
    String type,
    String id,
    String recordId,
    String comment) async {
  try {
    FirebaseApp app = Instadiv.getInstance().firebaseApp;
    FirebaseFirestore firestore = FirebaseFirestore.instanceFor(app: app);

    Map<String, dynamic> data = {
      'comment' : comment
    };

    firestore
        .collection(instaCollection)
        .doc(Instadiv.getInstance().project)
        .collection(type)
        .doc(id)
        .collection('data')
        .doc(recordId)
        .update(data);
  } catch (e){
    print('Error $e');
  }
}