);

}];

You should now be able to run the app on iOS.
If using the iOS Simulator,
note that it doesn’t support battery APIs,
and the app displays ‘Battery level not available’.

Step 5: Add a Windows platform-specific implementation

Start by opening the Windows host portion of your Flutter app in Visual Studio:

Run flutter build windows in your project directory once to generate
the Visual Studio solution file.

Start Visual Studio.

Select Open a project or solution.

Navigate to the directory holding your Flutter app, then into the build
folder, then the windows folder, then select the batterylevel.sln file.
Click Open.

Add the C++ implementation of the platform channel method:

Expand batterylevel > Source Files in the Solution Explorer.

Open the file flutter_window.cpp.