setCounterField method
void
setCounterField({})
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,
);