BatteryLevelStatus constructor

BatteryLevelStatus({
  1. required bool isBatteryPresent,
  2. required bool isWirelessCharging,
  3. required bool isWiredCharging,
  4. required bool isCharging,
  5. required bool isBatteryFaulty,
  6. required int percentage,
})

Constructs a BatteryLevelStatus object containing information about the battery's state, charging method, and percentage.

  • isBatteryPresent: Indicates if the battery is physically present.
  • isWirelessCharging: Shows if the device is charging wirelessly.
  • isWiredCharging: Shows if the device is charging via a wired connection.
  • isCharging: Indicates if the device is currently charging.
  • isBatteryFaulty: Indicates if there is a fault in the battery.
  • percentage: The battery level as a percentage, or -1 if unavailable.

Implementation

BatteryLevelStatus({
  required this.isBatteryPresent,
  required this.isWirelessCharging,
  required this.isWiredCharging,
  required this.isCharging,
  required this.isBatteryFaulty,
  required this.percentage,
});