Flutter Windows Embedder
flutter::FlutterWindowsViewController Class Reference

Controls a view that displays Flutter content. More...

#include <flutter_windows_view_controller.h>

Public Member Functions

 FlutterWindowsViewController (std::unique_ptr< FlutterWindowsEngine > engine, std::unique_ptr< FlutterWindowsView > view)
 
 ~FlutterWindowsViewController ()
 
void Destroy ()
 
FlutterWindowsEngineengine ()
 
FlutterWindowsViewview ()
 

Detailed Description

Controls a view that displays Flutter content.

Definition at line 17 of file flutter_windows_view_controller.h.

Constructor & Destructor Documentation

◆ FlutterWindowsViewController()

flutter::FlutterWindowsViewController::FlutterWindowsViewController ( std::unique_ptr< FlutterWindowsEngine engine,
std::unique_ptr< FlutterWindowsView view 
)
inline

Definition at line 19 of file flutter_windows_view_controller.h.

21  : engine_(std::move(engine)), view_(std::move(view)) {}

◆ ~FlutterWindowsViewController()

flutter::FlutterWindowsViewController::~FlutterWindowsViewController ( )

Definition at line 9 of file flutter_windows_view_controller.cc.

9  {
10  Destroy();
11 }

References Destroy().

Member Function Documentation

◆ Destroy()

void flutter::FlutterWindowsViewController::Destroy ( )

Definition at line 13 of file flutter_windows_view_controller.cc.

13  {
14  if (!view_) {
15  return;
16  }
17 
18  // Prevent the engine from rendering into this view.
19  if (view_->GetEngine()->running()) {
20  auto view_id = view_->view_id();
21 
22  view_->GetEngine()->RemoveView(view_id);
23  }
24 
25  // Destroy the view, followed by the engine if it is owned by this controller.
26  view_.reset();
27  engine_.reset();
28 }

Referenced by ~FlutterWindowsViewController().

◆ engine()

FlutterWindowsEngine* flutter::FlutterWindowsViewController::engine ( )
inline

Definition at line 30 of file flutter_windows_view_controller.h.

30 { return view_->GetEngine(); }

◆ view()

FlutterWindowsView* flutter::FlutterWindowsViewController::view ( )
inline

Definition at line 31 of file flutter_windows_view_controller.h.

31 { return view_.get(); }

The documentation for this class was generated from the following files:
flutter::FlutterWindowsViewController::view
FlutterWindowsView * view()
Definition: flutter_windows_view_controller.h:31
flutter::FlutterWindowsViewController::engine
FlutterWindowsEngine * engine()
Definition: flutter_windows_view_controller.h:30
flutter::FlutterWindowsViewController::Destroy
void Destroy()
Definition: flutter_windows_view_controller.cc:13