if

([

@"getBatteryLevel"

isEqualToString

call

method

])

int

batteryLevel

weakSelf

getBatteryLevel

];

if

batteryLevel

==

result

([

FlutterError

errorWithCode

@"UNAVAILABLE"

message:

@"Battery level not available."

details:

nil

]);

else

result

batteryLevel

));

else

result

FlutterMethodNotImplemented

);

}];