Open the file flutter_window.cpp.

First, add the necessary includes to the top of the file, just
after #include "flutter_window.h":

#include

<flutter/event_channel.h>

#include

<flutter/event_sink.h>

#include

<flutter/event_stream_handler_functions.h>

#include

<flutter/method_channel.h>

#include

<flutter/standard_method_codec.h>

#include

<windows.h>

#include

<memory>

Edit the FlutterWindow::OnCreate method and create
a flutter::MethodChannel tied to the channel name
samples.flutter.dev/battery:

bool

FlutterWindow

::

OnCreate