update: router path

This commit is contained in:
sanfan.hx
2019-08-15 16:31:22 +08:00
parent 555241b0a1
commit 0f23d5d5fe
4 changed files with 7 additions and 3 deletions

View File

@ -443,11 +443,12 @@ class _History extends State<History> {
if (WidgetName2Icon.icons[value.name] != null) {
icon = Icon(WidgetName2Icon.icons[value.name], size: 25);
}
String targetRouter = value.targetRouter;
list.add(
InkWell(
onTap: () {
Application.router.navigateTo(context, "${value.targetRouter}", transition: TransitionType.inFromRight);
Application.router.navigateTo(context, "${targetRouter.toLowerCase()}", transition: TransitionType.inFromRight);
},
child: Chip(
avatar: icon,

View File

@ -35,6 +35,7 @@ class WidgetItemContainer extends StatelessWidget {
widgetDemosList.forEach((item) {
if (item.name == targetName) {
targetRouter = item.routerName;
targetRouter = targetRouter.toLowerCase();
}
});
Application.router.navigateTo(context, targetRouter, transition: TransitionType.inFromRight);

View File

@ -41,7 +41,8 @@ class Routes {
name: 'component', parameters: {'name': demo.routerName });
return demo.buildRouter(context);
});
router.define('${demo.routerName}', handler: handler);
String path = demo.routerName;
router.define('${path.toLowerCase()}', handler: handler);
});
router.define(standardPage,handler:standardPageHandler);
// router.define(webViewPage,handler:webViewPageHand);

View File

@ -93,7 +93,8 @@ class _MyHomePageState extends State<AppPage>
searchHistoryList.add(
SearchHistory(name: targetName, targetRouter: widgetPoint.routerName));
print("searchHistoryList1 ${searchHistoryList.toString()}");
Application.router.navigateTo(context, widgetPoint.routerName,
String targetRouter = widgetPoint.routerName;
Application.router.navigateTo(context, targetRouter.toLowerCase(),
transition: TransitionType.inFromRight);
}