$ cd some/path/ $ flutter create -t module my_flutter
下载future module
-
打开podfile
flutter_application_path = '../scflutter_module1' //下载module的相对路径
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)屏幕快照 2019-08-09 上午11.23.19.png
执行。pod install
3.

一个是flutter sdk的路径。 一个是module的路径
-
屏幕快照 2019-08-09 上午11.27.59.png
屏幕快照 2019-08-09 上午11.28.06.png

Run Script 需要设置
"FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed

修改为no
5.入口

需要的话。设置 flutter 路由
Objective-C:
[flutterViewController setInitialRoute:@"route1"];
Swift:
flutterViewController.setInitialRoute("route1")
这样就完成了 最简单的flutter 集成!!
网友评论