produceBattery static method

Battery produceBattery({
  1. DateTime? acquisitionTime,
  2. int level = 0,
  3. BatteryState state = BatteryState.unknown,
  4. BatteryHealth health = BatteryHealth.unknown,
  5. bool lowBatteryNoticed = false,
  6. PluggedType pluggedType = PluggedType.unplugged,
  7. int voltage = 0,
  8. int temperature = 0,
})

Produces a new Battery from provided parameters

Implementation

static Battery produceBattery({
  final DateTime? acquisitionTime,
  final int level = 0,
  final BatteryState state = BatteryState.unknown,
  final BatteryHealth health = BatteryHealth.unknown,
  final bool lowBatteryNoticed = false,
  final PluggedType pluggedType = PluggedType.unplugged,
  final int voltage = 0,
  final int temperature = 0,
}) {
  return BatteryImpl(
    type: DataType.battery,
    acquisitionTime: acquisitionTime ?? DateTime.now(),
    level: level,
    state: state,
    health: health,
    lowBatteryNoticed: lowBatteryNoticed,
    pluggedType: pluggedType,
    voltage: voltage,
    temperature: temperature,
  );
}