setCounterField method

void setCounterField({
  1. String counterSuffix = "Count",
  2. String counterBuilder(
    1. String path
    )?,
  3. String linkedCounterBuilder(
    1. String linkPath
    )?,
  4. List<CounterUpdaterInterval> counterIntervals = const [],
})

Create fields for counters.

Increases or decreases the number of fields marked with counterSuffix in the documents in the hierarchy above the collectionPath or linkedCollectionPath specified when the Builder is created, depending on the increase or decrease in the number of elements.

You can set up your own counter path using counterBuilder or linkedCounterBuilder.

Time-delimited counters can be set up by specifying counterIntervals.

Implementation

void setCounterField({
  String counterSuffix = "Count",
  String Function(String path)? counterBuilder,
  String Function(String linkPath)? linkedCounterBuilder,
  List<CounterUpdaterInterval> counterIntervals = const [],
}) =>
    builder.setCounterField(
      counterBuilder: counterBuilder,
      counterSuffix: counterSuffix,
      linkedCounterBuilder: linkedCounterBuilder,
      counterIntervals: counterIntervals,
    );