getBatteryInfo method
Implementation
@override
Future<BatteryInfo> getBatteryInfo() async {
try {
final Map<dynamic, dynamic>? res = await methodChannel.invokeMethod('getBatteryInfo');
if (res == null) return const BatteryInfo();
return BatteryInfo.fromMap(res.cast<String, dynamic>());
} on PlatformException catch (e) {
throw DeviceInspectorException(_mapErrorCode(e.code), e.message ?? 'Failed to get battery info', cause: e);
} catch (e) {
return const BatteryInfo();
}
}