我正在尝试从 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;