getChargingStatus method

ChargingStatus getChargingStatus(
  1. String? status
)

Retrieves the chargin status from the native value

Implementation

ChargingStatus getChargingStatus(String? status) {
  switch (status) {
    case "charging":
      return ChargingStatus.Charging;
    case "discharging":
      return ChargingStatus.Discharging;
    case "full":
      return ChargingStatus.Full;
    default:
      return ChargingStatus.Unknown;
  }
}