BatteryInfo class

Information about the device's battery status and health.

Contains details about battery level, charging status, health, and other battery-related metrics.

Annotations

Constructors

BatteryInfo({required int batteryLevel, required String chargingStatus, required String batteryHealth, required int batteryCapacity, required double batteryVoltage, required double batteryTemperature})
Creates a new BatteryInfo instance.
const

Properties

batteryCapacity int
Battery capacity in mAh (milliampere-hours).
final
batteryHealth String
Battery health status ('good', 'poor', 'dead', 'unknown').
final
batteryLevel int
Current battery level as a percentage (0-100).
final
batteryTemperature double
Current battery temperature in Celsius.
final
batteryTemperatureFahrenheit double
Gets battery temperature in Fahrenheit.
no setter
batteryVoltage double
Current battery voltage in volts.
final
chargingStatus String
Current charging status ('charging', 'discharging', 'full', 'unknown').
final
hashCode int
The hash code for this object.
no setteroverride
isCharging bool
Whether the battery is currently charging.
no setter
isCriticalBattery bool
Whether the battery level is critical (below 10%).
no setter
isFullyCharged bool
Whether the battery is fully charged.
no setter
isHealthy bool
Whether the battery is in good health.
no setter
isLowBattery bool
Whether the battery level is low (below 20%).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({int? batteryLevel, String? chargingStatus, String? batteryHealth, int? batteryCapacity, double? batteryVoltage, double? batteryTemperature}) BatteryInfo
Creates a copy of this BatteryInfo with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override