ios - 为什么在将现有的原生项目与flutter代码结合时使用模块模板?

标签 ios flutter module

将 flutter 集成到现有项目(iOS)时有 these steps to follow .

但作为替代方案,我们也可以使用:

flutter 创建

代替:

flutter create-t 模块

只需将类、pod 以及原始项目中没有的内容添加到 ios 子文件夹中创建的运行程序项目中即可。

为什么创建模板模块(-t 模块)并将该模块添加到 iOS 项目中是首选方式?

最佳答案

感谢xster .

Theoretically, flutter create should just be a strict superset of flutter 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/

相关文章:

ios - 如何隐藏委托(delegate)中的导航栏

objective-c - 哪种数据存储类型是存储从服务器接收的数据的最佳方式?

linux - 连接服务协议(protocol)时出错 : failed to connect to http://127. 0.0.1:41209/y-F2GYjV9_Y=/

flutter - 从 FlatButton 迁移到 TextButton 时如何指定 disabledTextColor

swift - 许多目标中的相同扩展

c++ - Qt:从 button_click 返回 main

javascript - iOS 中 JavaScript Date() 函数的行为不一致

ios - 导航项中不支持 Swift 纯样式

android - android 12 更新后在特定设备上得到 "lacks permission android.permission.BLUETOOTH"

es6 导入和导出中的模块说明符