FormatterSnapshot.rate constructor

FormatterSnapshot.rate({
  1. required Iterable<DataRate> rateSamples,
  2. required Iterable<ByteFormatOptions> options,
  3. String sampleLabeler(
    1. DataRate sample
    )?,
  4. String optionLabeler(
    1. ByteFormatOptions option
    )?,
})

Builds a snapshot for DataRate samples.

Implementation

FormatterSnapshot.rate({
  required Iterable<DataRate> rateSamples,
  required Iterable<ByteFormatOptions> options,
  String Function(DataRate sample)? sampleLabeler,
  String Function(ByteFormatOptions option)? optionLabeler,
})  : _kind = _SnapshotKind.rate,
      _sizeSamples = const [],
      _rateSamples = List<DataRate>.from(rateSamples, growable: false),
      _options = List<ByteFormatOptions>.from(options, growable: false),
      _sizeLabeler = _defaultSizeLabeler,
      _rateLabeler = sampleLabeler ?? _defaultRateLabeler,
      _optionLabeler = optionLabeler ?? _defaultOptionLabeler;