File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,10 +30,28 @@ bool FlutterWindow::OnCreate() {
3030 // The size here must match the window dimensions to avoid unnecessary surface
3131 // creation / destruction in the startup path.
3232 printf (" [FlutterWindow] 创建 FlutterViewController...\n " );
33- flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
34- frame.right - frame.left , frame.bottom - frame.top , project_);
33+ printf (" [FlutterWindow] 窗口尺寸: %d x %d\n " ,
34+ frame.right - frame.left , frame.bottom - frame.top );
35+
36+ try {
37+ flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
38+ frame.right - frame.left , frame.bottom - frame.top , project_);
39+ printf (" [FlutterWindow] FlutterViewController 创建成功\n " );
40+ } catch (const std::exception& e) {
41+ printf (" [FlutterWindow] 异常: 创建 FlutterViewController 时发生异常: %s\n " , e.what ());
42+ return false ;
43+ } catch (...) {
44+ printf (" [FlutterWindow] 异常: 创建 FlutterViewController 时发生未知异常\n " );
45+ return false ;
46+ }
3547
3648 // Ensure that basic setup of the controller was successful.
49+ if (!flutter_controller_) {
50+ printf (" [FlutterWindow] 错误: FlutterController 指针为空\n " );
51+ return false ;
52+ }
53+
54+ printf (" [FlutterWindow] 检查 Flutter 引擎...\n " );
3755 if (!flutter_controller_->engine ()) {
3856 printf (" [FlutterWindow] 错误: Flutter 引擎为空\n " );
3957 return false ;
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ echo ========================================
44echo 小纯观影馆 - Windows 详细日志查看工具
55echo ========================================
66echo .
7- echo 此脚本将 :
8- echo 1. 检查所有必需文件
9- echo 2. 显示环境信息
10- echo 3. 启动应用并显示所有日志
7+ echo 此脚本将执行以下操作 :
8+ echo 1. 检查所有必需文件
9+ echo 2. 显示环境信息
10+ echo 3. 启动应用并显示所有日志
1111echo .
1212echo 按 Ctrl+C 可以停止应用和日志查看
1313echo .
You can’t perform that action at this time.
0 commit comments