You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
928 B

2 years ago
  1. #ifndef RUNNER_FLUTTER_WINDOW_H_
  2. #define RUNNER_FLUTTER_WINDOW_H_
  3. #include <flutter/dart_project.h>
  4. #include <flutter/flutter_view_controller.h>
  5. #include <memory>
  6. #include "win32_window.h"
  7. // A window that does nothing but host a Flutter view.
  8. class FlutterWindow : public Win32Window {
  9. public:
  10. // Creates a new FlutterWindow hosting a Flutter view running |project|.
  11. explicit FlutterWindow(const flutter::DartProject& project);
  12. virtual ~FlutterWindow();
  13. protected:
  14. // Win32Window:
  15. bool OnCreate() override;
  16. void OnDestroy() override;
  17. LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
  18. LPARAM const lparam) noexcept override;
  19. private:
  20. // The project to run.
  21. flutter::DartProject project_;
  22. // The Flutter instance hosted by this window.
  23. std::unique_ptr<flutter::FlutterViewController> flutter_controller_;
  24. };
  25. #endif // RUNNER_FLUTTER_WINDOW_H_