Skip to content

Instantly share code, notes, and snippets.

@loic-sharma
Last active June 14, 2023 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loic-sharma/c9f8ce625069e23149967c92a28acdbd to your computer and use it in GitHub Desktop.
Save loic-sharma/c9f8ce625069e23149967c92a28acdbd to your computer and use it in GitHub Desktop.
Windows runner APIs
{
// Create a view. The view controller takes ownership of the engine.
auto controller = FlutterDesktopViewControllerCreate(width, height, engine);
auto view = FlutterDesktopViewControllerGetView(controller);
HWND hwnd = FlutterDesktopViewGetHWND(view);
// Attach the view's HWND to the window...
// Run app...
// Destroy the view controller. This also destroys the view and the engine.
FlutterDesktopViewControllerDestroy(controller);
}
{
// Create a view controller. This also creates an engine and a view.
auto controller = std::make_unique<flutter::FlutterViewController>(
width, height, project);
HWND hwnd = controller->view()->GetNativeWindow();
// Attach the view's HWND to the window...
// Run app...
// Destroy the view controller. This also destroys the view and the engine.
controller.reset();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment