1
This commit is contained in:
@@ -20,5 +20,5 @@ class RoutePaths {
|
||||
static const planHistory = "/planHistory";
|
||||
|
||||
///计划详情页
|
||||
static const planDetail = "/planDetail";
|
||||
static String planDetail([int? id]) => id != null ? "/planDetail/$id" : "/planDetail/:id";
|
||||
}
|
||||
|
||||
@@ -11,9 +11,15 @@ List<RouteType> planRoutes = [
|
||||
},
|
||||
),
|
||||
RouteType(
|
||||
path: RoutePaths.planDetail,
|
||||
path: RoutePaths.planDetail(),
|
||||
child: (state) {
|
||||
return PlanDetailPage();
|
||||
final id = state.pathParameters['id'];
|
||||
final extraMap = state.extra as Map<String, dynamic>?;
|
||||
|
||||
return PlanDetailPage(
|
||||
id: id,
|
||||
planName: extraMap?['name'],
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
@@ -22,7 +22,7 @@ List<RouteBase> routes = routeConfigs.map((item) {
|
||||
|
||||
//变量命名
|
||||
GoRouter goRouter = GoRouter(
|
||||
initialLocation: RoutePaths.layout,
|
||||
initialLocation: RoutePaths.splash,
|
||||
routes: routes,
|
||||
navigatorKey: navigatorKey,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user