将 flutter 集成到现有项目(iOS)时有 these steps to follow .
但作为替代方案,我们也可以使用:
flutter 创建
代替:
flutter create
-t 模块
只需将类、pod 以及原始项目中没有的内容添加到 ios 子文件夹中创建的运行程序项目中即可。
为什么创建模板模块(-t 模块)并将该模块添加到 iOS 项目中是首选方式?
最佳答案
感谢xster .
<小时/>Theoretically,
flutter create
should just be a strict superset offlutter create -t module
(with flutter create having a more fleshed out iOS xcode project wrapper that you can tweak and own).But in implementation, there might be slight differences that we haven't fully tested against with the rest of the add-to-app flow.
We should merge them one day once the #37910 cleanup is done.
For convenience, it would do the exact same thing as it does today from the surface. But behind the scene, it's shimmed out by 2 things (which we can rename to make them more first class etc). A flutter create -t module my_flutter_module and a flutter create-wrapper-project my_test_launcher --from-module ../my_flutter_module. But you can independently do just one of the 2. e.g. you would call flutter create -t module to make a new Flutter module. You would call flutter create-wrapper-project if you're trying to create another project around an existing module etc.
关于ios - 为什么在将现有的原生项目与flutter代码结合时使用模块模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58751287/