将原项目转换成module的形式
进入项目使用命令行打包
flutter build ios-framework --output=../flutter_app
打出包后,分为debug、profile、release三种形式
![](https://img.haomeiwen.com/i2444070/18585fec7625d7e2.png)
![](https://img.haomeiwen.com/i2444070/cbcf6a65fe16b8cb.png)
#import "ViewController.h"
#import <Flutter/Flutter.h>
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 40)];
[btn setTitle:@"按钮" forState:UIControlStateNormal];
[btn setTitleColor:UIColor.orangeColor forState:UIControlStateNormal];
[btn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
}
-(void)clickAction {
FlutterViewController * flutter = [[FlutterViewController alloc]init];
flutter.view.backgroundColor = [UIColor yellowColor];
[self presentViewController:flutter animated:YES completion:^{
}];
}
@end
网友评论