result

));

Finally, add the battery_method_call_handler function referenced
in the earlier call to fl_method_channel_set_method_call_handler.
You need to handle a single platform method, getBatteryLevel,
so test for that in the method_call argument.
The implementation of this function calls
the Linux code written in the previous step. If an unknown method
is called, report that instead.

Add the following code after the get_battery_level function:

static

void

battery_method_call_handler

FlMethodChannel

channel

FlMethodCall

method_call

gpointer

user_data

g_autoptr

FlMethodResponse

response

nullptr

if

strcmp