Commit 7d66d8cd authored by yangwu.jia's avatar yangwu.jia

Page name update

parent e26225b4
......@@ -277,7 +277,6 @@ public class NewBoostFlutterActivity extends Activity
protected void onStop() {
super.onStop();
delegate.onStop();
// lifecycle.handleLifecycleEvent(Lifecycle.Event.ON_STOP);
}
@Override
......
......@@ -12,14 +12,14 @@ import java.util.Map;
public class PageRouter {
public final static Map<String, String> pageName = new HashMap<String, String>() {{
put("sample://flutterPage1", "flutterPage1");
put("sample://flutterPage2", "flutterPage2");
put("sample://flutterPage3", "flutterPage3");
put("sample://flutterMain", "flutterMain");
put("sample://first", "first");
put("sample://second", "second");
put("sample://tab", "tab");
put("sample://flutterPage", "flutterPage");
}};
public static final String NATIVE_PAGE_URL = "sample://nativePage";
public static final String FLUTTER_PAGE_URL = "sample://flutterMain";
public static final String FLUTTER_PAGE_URL = "sample://flutterPage";
public static final String FLUTTER_FRAGMENT_PAGE_URL = "sample://flutterFragmentPage";
public static boolean openPageByUrl(Context context, String url, Map params) {
......
......@@ -17,12 +17,12 @@ class _MyAppState extends State<MyApp> {
super.initState();
FlutterBoost.singleton.registerPageBuilders({
'flutterPage1': (pageName, params, _) => FirstRouteWidget(),
'flutterPage2': (pageName, params, _) => SecondRouteWidget(),
'flutterPage3': (pageName, params, _) => TabRouteWidget(),
'first': (pageName, params, _) => FirstRouteWidget(),
'second': (pageName, params, _) => SecondRouteWidget(),
'tab': (pageName, params, _) => TabRouteWidget(),
'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params),
///可以在native层通过 getContainerParams 来传递参数
'flutterMain': (pageName, params, _) {
'flutterPage': (pageName, params, _) {
print("flutterPage params:$params");
return FlutterRouteWidget(params:params);
......
......@@ -14,7 +14,7 @@ class FirstRouteWidget extends StatelessWidget {
child: Text('Open second route'),
onPressed: () {
print("open second page!");
FlutterBoost.singleton.open("sample://flutterPage2").then((Map value) {
FlutterBoost.singleton.open("sample://second").then((Map value) {
print(
"call me when page is finished. did recieve second route result $value");
});
......@@ -59,7 +59,7 @@ class TabRouteWidget extends StatelessWidget {
body: Center(
child: RaisedButton(
onPressed: () {
FlutterBoost.singleton.open("sample://flutterPage2");
FlutterBoost.singleton.open("sample://second");
},
child: Text('Open second route'),
),
......@@ -140,14 +140,14 @@ class _FlutterRouteWidgetState extends State<FlutterRouteWidget> {
margin: const EdgeInsets.all(8.0),
color: Colors.yellow,
child: Text(
'open flutterPage1',
'open first',
style: TextStyle(fontSize: 22.0, color: Colors.black),
)),
///后面的参数会在native的IPlatform.startActivity方法回调中拼接到url的query部分。
///例如:sample://nativePage?aaa=bbb
onTap: () => FlutterBoost.singleton
.open("sample://flutterPage1", urlParams: {
.open("sample://first", urlParams: {
"query": {"aaa": "bbb"}
}),
),
......@@ -157,14 +157,14 @@ class _FlutterRouteWidgetState extends State<FlutterRouteWidget> {
margin: const EdgeInsets.all(8.0),
color: Colors.yellow,
child: Text(
'open flutterPage2',
'open second',
style: TextStyle(fontSize: 22.0, color: Colors.black),
)),
///后面的参数会在native的IPlatform.startActivity方法回调中拼接到url的query部分。
///例如:sample://nativePage?aaa=bbb
onTap: () => FlutterBoost.singleton
.open("sample://flutterPage2", urlParams: {
.open("sample://second", urlParams: {
"query": {"aaa": "bbb"}
}),
),
......@@ -174,14 +174,14 @@ class _FlutterRouteWidgetState extends State<FlutterRouteWidget> {
margin: const EdgeInsets.all(8.0),
color: Colors.yellow,
child: Text(
'open flutterPage3',
'open tab',
style: TextStyle(fontSize: 22.0, color: Colors.black),
)),
///后面的参数会在native的IPlatform.startActivity方法回调中拼接到url的query部分。
///例如:sample://nativePage?aaa=bbb
onTap: () => FlutterBoost.singleton
.open("sample://flutterPage3", urlParams: {
.open("sample://tab", urlParams: {
"query": {"aaa": "bbb"}
}),
),
......
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