flutter - FlutterViewController setInitialRoute for windows
问题描述
我正在尝试从 Native flutter Pugin 导航到特定路线。我能够在 iOS 上快速做到这一点:
let extVC = FlutterViewController()
extVC.setInitialRoute(routerName)
window?.rootViewController = extVC
setInitialRoute
Windows的flutter native(c ++)插件中的等效项是什么?
bool FlutterWindow::OnCreate() {
if (!Win32Window::OnCreate()) {
return false;
}
RECT frame = GetClientArea();
// The size here must match the window dimensions to avoid unnecessary surface
// creation / destruction in the startup path.
flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
frame.right - frame.left, frame.bottom - frame.top, project_);
// Ensure that basic setup of the controller was successful.
if (!flutter_controller_->engine() || !flutter_controller_->view()) {
return false;
}
run_loop_->RegisterFlutterInstance(flutter_controller_->engine());
SetChildContent(flutter_controller_->view()->GetNativeWindow());
return true;
解决方案
Windows 嵌入 API 目前没有等效项。您应该提交一个请求您需要的功能的问题。
推荐阅读
- c++ - Microsoft Visual C++ Redistributable 包提取的 dll 文件是什么?
- amazon-web-services - 手动将缺失值发送到 Amazon Forecast
- mysql - 在 SQL 中选择发送者和接收者之间的最后一条消息
- javascript - 如何在自定义钩子中测试 useEffect?
- python - 从excel列中选择行并根据Python中的另一列生成新列
- sql - 具有动态 SQL 语句的 Redshift UDF 函数
- visual-studio-code - 在 VScode 中禁用快捷菜单栏
- apache-zookeeper - 如何将 Clickhouse 的 Zookeeper 迁移到新实例?
- javascript - javascript计时器结束后显示页面的隐藏部分
- java - 尽管给出了 ID,但 Selenium 没有单击按钮(Java)