Skip to content

BatteryAwareSamplingConfiguration

A sampling configuration which changes based on how much battery the device has left.

Holds one SamplingConfiguration per battery level.

Inheritance
Annotations

Constructors

BatteryAwareSamplingConfiguration.fromJson

BatteryAwareSamplingConfiguration.fromJson(
  1. Map<String, dynamic> json
)

BatteryAwareSamplingConfiguration

BatteryAwareSamplingConfiguration({
  1. required SamplingConfiguration normal,
  2. required SamplingConfiguration low,
  3. SamplingConfiguration? critical,
})

Properties

critical

SamplingConfiguration? critical
getter/setter pair

The sampling configuration to use when the battery is critically low. By default, sampling should be disabled at this point.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

low

SamplingConfiguration low
getter/setter pair

The sampling configuration to use when the battery is low.

normal

SamplingConfiguration normal
getter/setter pair

The sampling configuration to use when there is plenty of battery left.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.