func

receiveBatteryLevel

result

FlutterResult

let

device

UIDevice

current

device

isBatteryMonitoringEnabled

true

if

device

batteryState

==

UIDevice

BatteryState

unknown

result

FlutterError

code

"UNAVAILABLE"

message

"Battery level not available."

details

nil

))

else

result

Int

device

batteryLevel

100

))