MyApplication

self

MY_APPLICATION

object

);

g_clear_pointer

self

>

dart_entrypoint_arguments

g_strfreev

);

g_clear_object

self

>

battery_channel

);

G_OBJECT_CLASS

my_application_parent_class

>

dispose

object

);

Edit the my_application_activate method and initialize
battery_channel using the channel name
samples.flutter.dev/battery, just after the call to
fl_register_plugins:

static

void

my_application_activate

GApplication

application