codec

));

fl_method_channel_set_method_call_handler

self

>

battery_channel

battery_method_call_handler

self

nullptr

);

gtk_widget_grab_focus

GTK_WIDGET

self

>

view

));

Next, add the C code that uses the Linux battery APIs to
retrieve the battery level. This code is exactly the same as
you would write in a native Linux application.

Add the following as a new function at the top of
my_application.cc just after the G_DEFINE_TYPE line:

static

FlMethodResponse

get_battery_level

()