- Xcode创建一个Swift项目Swift2FlutterDemo
- 使用CocoaPods安装Flutter SDK
pod init
3.在Swift2FlutterDemo文件夹下面 创建Flutter模块
flutter create --template module my_flutter
4 编写Podfile文件
#添加模块所在的路径
flutter_application_path = './my_flutter'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'Swift2FlutterDemo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Swift2FlutterDemo
#安装Flutter模块
install_all_flutter_pods(flutter_application_path)
end
post_install do |installer|
flutter_post_install(installer)
end
5 CocoaPods安装依赖
pod install
网友评论