counter method

int counter(
  1. String key
)

Current value of a named counter, or 0 if never set.

Implementation

int counter(String key) => _counters[key] ?? 0;