一、首先新建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

本文介绍了如何将 Flutter 模块集成到现有的 iOS 项目中,主要聚焦于使用 CocoaPods 和 Flutter SDK 的方法。首先确保 iOS 项目支持 CocoaPods,然后创建 Flutter module,通过在 Podfile 中添加必要配置并执行 pod install 进行集成。当 Flutter plugin 依赖变更时,需要更新 Flutter module 并重新执行 pod install。
最低0.47元/天 解锁文章
1731

被折叠的 条评论
为什么被折叠?



