dbIncrementCounter function

dynamic dbIncrementCounter(
  1. String tableName,
  2. String document,
  3. String field,
  4. int value,
)

Implementation

dbIncrementCounter(String tableName, String document, String field, int value) async{
  await FirebaseFirestore.instance.collection(tableName).doc(document).set(
      {field: FieldValue.increment(value)}, SetOptions(merge:true));
}