decrement method

Future<void> decrement(
  1. {required String field,
  2. String? docId,
  3. num value = 1}
)

update field realtime value that tells the server to decrement the field’s current value by the given value.

Implementation

Future<void> decrement({
  required String field,
  String? docId,
  num value = 1,
}) async {
  return await this
      .update(docId: docId, data: {field: FieldValue.increment(-value)});
}