1、创建 Flutter module
在桌面创建project目录
cd /Users/imac/Desktop/project
flutter create --template module my_flutter
2、将iOS项目(CureFunNew)放入my_flutter同一级目录
iOS项目(MyApp)放入后project目录结构
/Users/imac/Desktop/project/
├── my_flutter/
│ └── .ios/
│ └── Flutter/
│ └── podhelper.rb
└── CureFunNew/
└── Podfile
3、给iOS项目中Podfile文件添加命令
flutter_application_path = '../my_flutter'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
install_all_flutter_pods(flutter_application_path)
加入命令后样子
4、执行pod install命令
pod install
执行成功效果
这里第一次运行遇见问题
[!] CocoaPods could not find compatible versions for pod "my_flutter":
In Podfile:
my_flutter (from `../my_flutter/.ios/Flutter`)
Specs satisfying the `my_flutter (from `../my_flutter/.ios/Flutter`)` dependency were found, but they required a higher minimum deployment target.
原因:Podfile中需要将最低目标版本设置为9.0