一、首先新建iOS项目,iOS项目需要支持cocopod,
现有项目支持cocopod方法:1、cd 到项目xcode目录 XXXX.xcodeproj
2、新建Podfile文件,可使用命令:touch Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
#use_frameworks!个别需要用到它,比如reactiveCocoa
def pods
pod 'AFNetworking', '~> 2.6'
#pod 'ORStackView', '~> 3.0'
#pod 'SwiftyJSON', '~> 2.3'
end
target 'BGTextDemo' do
pods
flutter_application_path = '../my_flutterdemo'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
install_all_flutter_pods(flutter_application_path)
end
3、pod install 完成
二、在你的既有应用中集成 Flutter module
参考链接:https://flutter.cn/docs/development/add-to-app/ios/project-setup
1、创建 Flutter module
cd some/path/
flutter create --template module my_flutter