Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
soloxiao authored Nov 22, 2021
1 parent e6dba30 commit afb251e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ BKFlutterWebNativeBridge建立了flutter web页面和native的通道,在贝壳

# 如何使用
我们以DEMO代码为例
##1. 本项目中会使用到Beike_AspectD,具体集成方式请参考Beike_AspectD的README。
##2. 在Flutter项目中添加以下依赖:
## 1. 本项目中会使用到Beike_AspectD,具体集成方式请参考Beike_AspectD的README。
## 2. 在Flutter项目中添加以下依赖:

```dart
beike_aspectd:
Expand All @@ -31,7 +31,7 @@ BKFlutterWebNativeBridge建立了flutter web页面和native的通道,在贝壳
path: ../lianjia_channel_web
```

##2. 在main.dart中添加依赖
## 3. 在main.dart中添加依赖
DEMO中main-local.dart是项目flutter native的入口,main-web.dart是项目flutter web的入口。在main-local.dart和main-web.dart中添加如下依赖

```dart
Expand All @@ -43,17 +43,17 @@ import 'package:lianjia_device_info_plugin/lianjia_device_info_plugin.dart';
```dart
import 'package:lianjia_channel_web/hook/hook.dart';
```
##3. Dart初始化
## 4. Dart初始化
在main-web.dart中进行初始化
```dart
LianjiaDeviceInfoPlugin.initPlugin();
```
##4. Web包编译及部署
## 5. Web包编译及部署
通过build web指令将flutter项目编译成web包并将编译产物部署到服务端。
```shell
flutter build web --target=lib/main-web.dart
```
##5. iOS中加载Flutter Web产物
## 6. iOS中加载Flutter Web产物
首先在iOS工程中pod中添加如下依赖
```dart
pod 'BKFLWebBrowser', :path => '../../BKFLWebBrowser-iOS', :subspecs => ['Flutter2Web']
Expand Down

0 comments on commit afb251e

Please sign in to comment.