36 lines
1014 B
Dart
36 lines
1014 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:proxibuy/presentation/ui/screens/home/details_page.dart';
|
|
import 'package:proxibuy/presentation/ui/screens/home/home_page.dart';
|
|
|
|
class AppRouter {
|
|
static final home = '/';
|
|
static final details = '/details';
|
|
static final GlobalKey<NavigatorState> navigatorKey =
|
|
GlobalKey<NavigatorState>();
|
|
|
|
GoRouter createRouter() {
|
|
return GoRouter(
|
|
navigatorKey: navigatorKey,
|
|
routes: [
|
|
// Define your routes here
|
|
GoRoute(
|
|
path: '/',
|
|
builder: (BuildContext context, GoRouterState state) {
|
|
return const MyHomePage();
|
|
},
|
|
routes: <RouteBase>[
|
|
GoRoute(
|
|
path: details,
|
|
builder: (BuildContext context, GoRouterState state) {
|
|
print(state.uri.queryParameters);
|
|
return const DetailsPage();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|