Commit 6ad9b300 authored by 汪洋's avatar 汪洋

删除 build 参数

parent c2950920
This diff is collapsed.
......@@ -19,17 +19,7 @@ class _MyAppState extends State<MyApp> {
super.initState();
FlutterBoost.singleton.registerPageBuilders({
'first': (pageName, params, _) => FirstRouteWidget(),
'second': (pageName, params, _) => SecondRouteWidget(),
'tab': (pageName, params, _) => TabRouteWidget(),
'flutterFragment': (pageName, params, _) => FragmentRouteWidget(params),
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
///可以在native层通过 getContainerParams 来传递参数
'flutterPage': (pageName, params, _) {
print("flutterPage params:$params");
return FlutterRouteWidget();
},
});
FlutterBoost.handleOnStartPage();
......@@ -38,54 +28,12 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
initialRoute: '/test',//调试的时候可以打开
routes: {
'/': (context) => CommentSuggest({'cookie': '124'}),
},//调试的时候可以打开
builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData(
primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF),
accentColor: Color(0xFF888888),
textTheme: TextTheme(
//设置Material的默认字体样式
body1: TextStyle(color: Color(0xFF888888), fontSize: 16.0),
),
iconTheme: IconThemeData(
color: Color(0xFFEFEFEF),
size: 35.0,
),
),
title: 'Flutter Boost example',
home: CommentSuggest({'cookie': '124'}),
);
// 我试了只写 home 是 OK 的
// 我试了 routes,是 OK 的
// 我把 build 删除了,是 OK 的
}
void _onRoutePushed(
String pageName, String uniqueId, Map params, Route route, Future _) {
// List<OverlayEntry> newEntries = route.overlayEntries
// .map((OverlayEntry entry) => OverlayEntry(
// builder: (BuildContext context) {
// final pageWidget = entry.builder(context);
// return Stack(
// children: <Widget>[
// pageWidget,
// Positioned(
// child: Text(
// "pageName:$pageName\npageWidget:${pageWidget.toStringShort()}",
// style: TextStyle(fontSize: 12.0, color: Colors.red),
// ),
// left: 8.0,
// top: 8.0,
// )
// ],
// );
// },
// opaque: entry.opaque,
// maintainState: entry.maintainState))
// .toList(growable: true);
//
// route.overlayEntries.clear();
// route.overlayEntries.addAll(newEntries);
}
}
......@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
......@@ -49,7 +49,7 @@ packages:
name: dio
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
version: "2.1.5"
flutter:
dependency: "direct main"
description: flutter
......@@ -103,7 +103,7 @@ packages:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2"
version: "2.0.3"
sky_engine:
dependency: transitive
description: flutter
......@@ -150,7 +150,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4"
version: "0.2.5"
typed_data:
dependency: transitive
description:
......
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