Commit 13ba5551 authored by yangwu.jia's avatar yangwu.jia

Merge branch 'feature/20190904' into develop

parents 7cd99953 c35de2ad
......@@ -14,7 +14,7 @@ A next-generation Flutter-Native hybrid solution. FlutterBoost is a Flutter plug
<a name="bf647454"></a>
# Prerequisites
You need to add Flutter to your project before moving on.
You need to add Flutter to your project before moving on.The version of the flutter SDK requires v1.5.4-hotfixes, or it will compile error.
# Getting Started
......@@ -60,8 +60,6 @@ class _MyAppState extends State<MyApp> {
'sample://secondPage': (pageName, params, _) => SecondRouteWidget(),
});
///query current top page and load it
FlutterBoost.handleOnStartPage();
}
@override
......@@ -163,7 +161,7 @@ public class MyApplication extends FlutterApplication {
@Override
public void openContainer(Context context, String url, Map<String, Object> urlParams, int requestCode, Map<String, Object> exts) {
PageRouter.openPageByUrl(context,url,urlParams,requestCode);
//native open url
}
@Override
......@@ -210,20 +208,15 @@ Android
```java
public class FlutterPageActivity extends BoostFlutterActivity {
@Override
public void onRegisterPlugins(PluginRegistry registry) {
//register flutter plugins
GeneratedPluginRegistrant.registerWith(registry);
}
@Override
public String getContainerName() {
public String getContainerUrl() {
//specify the page name register in FlutterBoost
return "sample://firstPage";
}
@Override
public Map getContainerParams() {
public Map getContainerUrlParams() {
//params of the page
Map<String,String> params = new HashMap<>();
params.put("key","value");
......@@ -235,21 +228,17 @@ public class FlutterPageActivity extends BoostFlutterActivity {
or
```java
public class FlutterFragment extends BoostFlutterFragment {
@Override
public void onRegisterPlugins(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
public class FlutterFragment extends BoostFlutterFragment {
@Override
public String getContainerName() {
return "sample://firstPage";
public String getContainerUrl() {
return "flutterFragment";
}
@Override
public Map getContainerParams() {
public Map getContainerUrlParams() {
Map<String,String> params = new HashMap<>();
params.put("key","value");
params.put("tag",getArguments().getString("tag"));
return params;
}
}
......@@ -282,6 +271,14 @@ Please see the example for details.
# License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
# Problem feedback group( dingding group)
<img width="200" src="https://img.alicdn.com/tfs/TB1JSzVeYY1gK0jSZTEXXXDQVXa-892-1213.jpg">
## 关于我们
阿里巴巴-闲鱼技术是国内最早也是最大规模线上运行Flutter的团队。
......
......@@ -13,7 +13,7 @@
# 前置条件
在继续之前,您需要将Flutter集成到你现有的项目中。
在继续之前,您需要将Flutter集成到你现有的项目中。flutter sdk 的版本需要 v1.5.4-hotfixes,否则会编译失败.
# 安装
......@@ -57,8 +57,6 @@ class _MyAppState extends State<MyApp> {
'sample://secondPage': (pageName, params, _) => SecondRouteWidget(),
});
///query current top page and load it
FlutterBoost.handleOnStartPage();
}
@override
......@@ -200,20 +198,15 @@ Android
```java
public class FlutterPageActivity extends BoostFlutterActivity {
@Override
public void onRegisterPlugins(PluginRegistry registry) {
//register flutter plugins
GeneratedPluginRegistrant.registerWith(registry);
}
@Override
public String getContainerName() {
public String getContainerUrl() {
//specify the page name register in FlutterBoost
return "sample://firstPage";
}
@Override
public Map getContainerParams() {
public Map getContainerUrlParams() {
//params of the page
Map<String,String> params = new HashMap<>();
params.put("key","value");
......@@ -226,18 +219,14 @@ public class FlutterPageActivity extends BoostFlutterActivity {
```java
public class FlutterFragment extends BoostFlutterFragment {
@Override
public void onRegisterPlugins(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
@Override
public String getContainerName() {
public String getContainerUrl() {
return "sample://firstPage";
}
@Override
public Map getContainerParams() {
public Map getContainerUrlParams() {
Map<String,String> params = new HashMap<>();
params.put("key","value");
return params;
......@@ -270,6 +259,11 @@ Dart
该项目根据MIT许可证授权 - 有关详细信息,请参阅[LICENSE.md](LICENSE.md)文件
<a name="Acknowledgments"> </a>
# 问题反馈群(钉钉群)
<img width="200" src="https://img.alicdn.com/tfs/TB1JSzVeYY1gK0jSZTEXXXDQVXa-892-1213.jpg">
## 关于我们
阿里巴巴-闲鱼技术是国内最早也是最大规模线上运行Flutter的团队。
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.idlefish.flutterboost">
<application>
<activity android:name="com.idlefish.flutterboost.containers.BoostFlutterDefaultActivity" />
</application>
</manifest>
package com.idlefish.flutterboost.containers;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import java.util.HashMap;
import java.util.Map;
public class BoostFlutterDefaultActivity extends BoostFlutterActivity {
@Override
public String getContainerUrl() {
return getIntent().getStringExtra("url");
}
@Override
public Map getContainerUrlParams() {
return (Map)(getIntent().getSerializableExtra("params"));
}
private static Intent intent(Context context, String url, HashMap<String, Object> params) {
final Intent intent = new Intent(context, BoostFlutterDefaultActivity.class);
intent.putExtra("url", url);
intent.putExtra("params", params);
return intent;
}
public static void open(Context context, String url, HashMap<String, Object> params) {
context.startActivity(intent(context, url, params));
}
public static void open(Activity activity, String url, HashMap<String, Object> params, int requestCode) {
activity.startActivityForResult(intent(activity, url, params), requestCode);
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment