add auth, format
This commit is contained in:
@@ -10,6 +10,8 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/features/account/presentation/pages/addresses_page.dart';
|
||||
import 'package:worker/features/account/presentation/pages/change_password_page.dart';
|
||||
import 'package:worker/features/account/presentation/pages/profile_edit_page.dart';
|
||||
import 'package:worker/features/auth/presentation/pages/login_page.dart';
|
||||
import 'package:worker/features/auth/presentation/pages/register_page.dart';
|
||||
import 'package:worker/features/cart/presentation/pages/cart_page.dart';
|
||||
import 'package:worker/features/cart/presentation/pages/checkout_page.dart';
|
||||
import 'package:worker/features/chat/presentation/pages/chat_list_page.dart';
|
||||
@@ -46,10 +48,24 @@ class AppRouter {
|
||||
/// Router configuration
|
||||
static final GoRouter router = GoRouter(
|
||||
// Initial route
|
||||
initialLocation: RouteNames.home,
|
||||
initialLocation: RouteNames.login,
|
||||
|
||||
// Route definitions
|
||||
routes: [
|
||||
// Authentication Routes
|
||||
GoRoute(
|
||||
path: RouteNames.login,
|
||||
name: RouteNames.login,
|
||||
pageBuilder: (context, state) =>
|
||||
MaterialPage(key: state.pageKey, child: const LoginPage()),
|
||||
),
|
||||
GoRoute(
|
||||
path: RouteNames.register,
|
||||
name: RouteNames.register,
|
||||
pageBuilder: (context, state) =>
|
||||
MaterialPage(key: state.pageKey, child: const RegisterPage()),
|
||||
),
|
||||
|
||||
// Main Route (with bottom navigation)
|
||||
GoRoute(
|
||||
path: RouteNames.home,
|
||||
@@ -278,8 +294,10 @@ class AppRouter {
|
||||
GoRoute(
|
||||
path: RouteNames.designRequestCreate,
|
||||
name: RouteNames.designRequestCreate,
|
||||
pageBuilder: (context, state) =>
|
||||
MaterialPage(key: state.pageKey, child: const DesignRequestCreatePage()),
|
||||
pageBuilder: (context, state) => MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: const DesignRequestCreatePage(),
|
||||
),
|
||||
),
|
||||
|
||||
// Design Request Detail Route
|
||||
@@ -421,7 +439,8 @@ class RouteNames {
|
||||
|
||||
// Model Houses & Design Requests Routes
|
||||
static const String modelHouses = '/model-houses';
|
||||
static const String designRequestCreate = '/model-houses/design-request/create';
|
||||
static const String designRequestCreate =
|
||||
'/model-houses/design-request/create';
|
||||
static const String designRequestDetail = '/model-houses/design-request/:id';
|
||||
|
||||
// Authentication Routes (TODO: implement when auth feature is ready)
|
||||
@@ -434,6 +453,12 @@ class RouteNames {
|
||||
///
|
||||
/// Helper extensions for common navigation patterns.
|
||||
extension GoRouterExtension on BuildContext {
|
||||
/// Navigate to login page
|
||||
void goLogin() => go(RouteNames.login);
|
||||
|
||||
/// Navigate to register page
|
||||
void goRegister() => go(RouteNames.register);
|
||||
|
||||
/// Navigate to home page
|
||||
void goHome() => go(RouteNames.home);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user