MCPcopy Create free account
hub / github.com/OldJii/ring_layout / OnCreate

Method OnCreate

example/windows/runner/flutter_window.cpp:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10FlutterWindow::~FlutterWindow() {}
11
12bool FlutterWindow::OnCreate() {
13 if (!Win32Window::OnCreate()) {
14 return false;
15 }
16
17 RECT frame = GetClientArea();
18
19 // The size here must match the window dimensions to avoid unnecessary surface
20 // creation / destruction in the startup path.
21 flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
22 frame.right - frame.left, frame.bottom - frame.top, project_);
23 // Ensure that basic setup of the controller was successful.
24 if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 return false;
26 }
27 RegisterPlugins(flutter_controller_->engine());
28 SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 return true;
30}
31
32void FlutterWindow::OnDestroy() {
33 if (flutter_controller_) {

Callers

nothing calls this directly

Calls 1

RegisterPluginsFunction · 0.85

Tested by

no test coverage detected