createObservableUpDownCounter<T extends num> method

APIObservableUpDownCounter<T> createObservableUpDownCounter<T extends num>({
  1. required String name,
  2. String? unit,
  3. String? description,
  4. ObservableCallback<T>? callback,
})

Creates an ObservableUpDownCounter with the given name.

An ObservableUpDownCounter is an asynchronous Instrument which reports values that increase or decrease when the instrument is being observed.

name The name of the instrument unit Optional unit of the instrument (e.g., "ms" for milliseconds) description Optional description of the instrument callback Optional callback to provide measurements when the instrument is observed

Implementation

APIObservableUpDownCounter<T> createObservableUpDownCounter<T extends num>({
  required String name,
  String? unit,
  String? description,
  ObservableCallback<T>? callback,
}) {
  if (name.isEmpty) {
    throw ArgumentError('ObservableUpDownCounter name must not be empty');
  }

  return ObservableUpDownCounterCreate.create<T>(
    name: name,
    unit: unit,
    description: description,
    meter: this,
    callback: callback,
  );
}