11import 'package:flutter/material.dart' ;
2+ import 'package:flutter_app_sample/component/login/login_page.dart' ;
23import 'package:flutter_app_sample/ui/base/AppCommonStatefulPage.dart' ;
3- import 'package:flutter_app_sample/component/login/LoginPage.dart' ;
44import 'package:flutter_app_sample/component/test/TestPage.dart' ;
55import 'package:flutter_app_sample/component/main/MainPage.dart' ;
66import 'package:flutter_app_sample/component/shop/ShoppingList.dart' ;
@@ -20,6 +20,7 @@ import 'package:flutter_app_sample/sample/notifier/CardMainPage.dart';
2020import 'package:flutter_app_sample/sample/notifier/CardInfoPage.dart' ;
2121import 'package:flutter_app_sample/sample/drag/DragListPage.dart' ;
2222import 'package:flutter_app_sample/sample/DrawerVariouslyPage.dart' ;
23+ import 'package:flutter_route/flutter_route.dart' ;
2324
2425// Register the RouteObserver as a navigation observer.
2526@deprecated //2019
@@ -31,34 +32,38 @@ void main() => runApp(MaterialApp(
3132 ),
3233
3334 ///全局静态路由的配置!
34- routes: < String , WidgetBuilder > {
35- "LoginPage" : (BuildContext context) => LoginPage (),
36- "MainPage" : (BuildContext context) => MainPage (),
37- "TestPage" : (BuildContext context) => TestPage (),
38- "ShoppingList" : (BuildContext context) => ShoppingListPage (),
39- "MainSortListPage" : (BuildContext context) => MainSortListPage (),
40- "ViewPagerFragmentPage" : (BuildContext context) =>
41- ViewPagerFragmentPage (),
42- "CollapsingToolbarPage" : (BuildContext context) =>
43- CollapsingToolbarPage (),
44- "MainAnimSortPage" : (BuildContext context) => MainAnimSortPage (),
45- "AnimOfSwitchPage" : (BuildContext context) => AnimOfSwitchPage (),
46- "AnimatedContainerPage" : (BuildContext context) =>
47- AnimatedContainerPage (),
48- "OpacityAndAnimatedOpacityPage" : (BuildContext context) =>
49- OpacityAndAnimatedOpacityPage (),
50- "FadeInImagePage" : (BuildContext context) => FadeInImagePage (),
51- "HeroAnimPage" : (BuildContext context) => HeroAnimPage (),
52- "TransformPage" : (BuildContext context) => TransformPage (),
53- "AnimatedBuilderPage" : (BuildContext context) => AnimatedBuilderPage (),
54- "ColorTweenPage" : (BuildContext context) => ColorTweenPage (),
55- "CardMainPage" : (BuildContext context) => CardMainPage (),
56- "CardInfoPage" : (BuildContext context) => CardInfoPage (),
57- "DragListPage" : (BuildContext context) => DragListPage (),
58- "DrawerVariouslyPage" : (BuildContext context) => DrawerVariouslyPage (),
59- },
35+ routes: RouteManager .initializeRoutes (
36+ routes: < String , WidgetBuilder > {
37+ "LoginPage" : (BuildContext context) => LoginPage (),
38+ "MainPage" : (BuildContext context) => MainPage (),
39+ "TestPage" : (BuildContext context) => TestPage (),
40+ "ShoppingList" : (BuildContext context) => ShoppingListPage (),
41+ "MainSortListPage" : (BuildContext context) => MainSortListPage (),
42+ "ViewPagerFragmentPage" : (BuildContext context) =>
43+ ViewPagerFragmentPage (),
44+ "CollapsingToolbarPage" : (BuildContext context) =>
45+ CollapsingToolbarPage (),
46+ "MainAnimSortPage" : (BuildContext context) => MainAnimSortPage (),
47+ "AnimOfSwitchPage" : (BuildContext context) => AnimOfSwitchPage (),
48+ "AnimatedContainerPage" : (BuildContext context) =>
49+ AnimatedContainerPage (),
50+ "OpacityAndAnimatedOpacityPage" : (BuildContext context) =>
51+ OpacityAndAnimatedOpacityPage (),
52+ "FadeInImagePage" : (BuildContext context) => FadeInImagePage (),
53+ "HeroAnimPage" : (BuildContext context) => HeroAnimPage (),
54+ "TransformPage" : (BuildContext context) => TransformPage (),
55+ "AnimatedBuilderPage" : (BuildContext context) =>
56+ AnimatedBuilderPage (),
57+ "ColorTweenPage" : (BuildContext context) => ColorTweenPage (),
58+ "CardMainPage" : (BuildContext context) => CardMainPage (),
59+ "CardInfoPage" : (BuildContext context) => CardInfoPage (),
60+ "DragListPage" : (BuildContext context) => DragListPage (),
61+ "DrawerVariouslyPage" : (BuildContext context) =>
62+ DrawerVariouslyPage (),
63+ },
64+ ),
6065 navigatorObservers: [
61- routeObserver ,
66+ RouteManager . getInstance () ,
6267 ],
6368 ));
6469
0 commit comments