search image in SauceNAO
This commit is contained in:
@ -11,6 +11,8 @@ class MyMaterialRouterConfig {
|
||||
|
||||
final GlobalKey<NavigatorState> _rootNavigatorKey =
|
||||
GlobalKey<NavigatorState>();
|
||||
final GlobalKey<NavigatorState> _shellNavigatorKey =
|
||||
GlobalKey<NavigatorState>();
|
||||
|
||||
MyMaterialRouterConfig(String? token) {
|
||||
router = GoRouter(
|
||||
@ -18,6 +20,7 @@ class MyMaterialRouterConfig {
|
||||
initialLocation: "/",
|
||||
routes: <RouteBase>[
|
||||
ShellRoute(
|
||||
navigatorKey: _shellNavigatorKey,
|
||||
builder: (BuildContext context, GoRouterState state, Widget child) {
|
||||
return HomePage(
|
||||
content: child,
|
||||
@ -25,29 +28,31 @@ class MyMaterialRouterConfig {
|
||||
},
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: "/",
|
||||
name: "相册",
|
||||
pageBuilder: (BuildContext context, GoRouterState state) =>
|
||||
const NoTransitionPage(child: Gallery()),
|
||||
redirect: (BuildContext context, GoRouterState state) {
|
||||
if (token == null || token.isEmpty) {
|
||||
return '/login';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
// routes: <RouteBase>[
|
||||
// GoRoute(
|
||||
// path: "detail",
|
||||
// name: "图片详情",
|
||||
// builder: (BuildContext context, GoRouterState state) =>
|
||||
// const ImageDetail())
|
||||
// ]
|
||||
path: "/",
|
||||
name: "相册",
|
||||
pageBuilder: (BuildContext context, GoRouterState state) =>
|
||||
const NoTransitionPage(
|
||||
child: Gallery(),
|
||||
),
|
||||
redirect: (BuildContext context, GoRouterState state) {
|
||||
if (token == null || token.isEmpty) {
|
||||
return '/login';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
// routes: <RouteBase>[
|
||||
// GoRoute(
|
||||
// path: "detail",
|
||||
// name: "图片详情",
|
||||
// builder: (BuildContext context, GoRouterState state) =>
|
||||
// const ImageDetail())
|
||||
// ]
|
||||
),
|
||||
GoRoute(
|
||||
path: "/detail",
|
||||
name: "图片详情",
|
||||
builder: (BuildContext context, GoRouterState state) =>
|
||||
const ImageDetail()),
|
||||
const ImageDetail()),
|
||||
GoRoute(
|
||||
path: "/profile",
|
||||
name: "个人资料",
|
||||
|
||||
Reference in New Issue
Block a user