return

int

)(

device

batteryLevel

100

);

Finally, complete the setMethodCallHandler() method added earlier.
You need to handle a single platform method, getBatteryLevel(),
so test for that in the call argument. The implementation of
this platform method calls the iOS code written in the previous step,
and returns a response for both the success and error cases using
the result argument. If an unknown method is called, report that instead.

__weak

typeof

self

weakSelf

self

batteryChannel

setMethodCallHandler

FlutterMethodCall

call

FlutterResult

result

// This method is invoked on the UI thread.

if

([

@"getBatteryLevel"