favorite
This commit is contained in:
@@ -7,6 +7,7 @@ library;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/features/cart/presentation/pages/cart_page.dart';
|
||||
import 'package:worker/features/favorites/presentation/pages/favorites_page.dart';
|
||||
import 'package:worker/features/main/presentation/pages/main_scaffold.dart';
|
||||
import 'package:worker/features/products/presentation/pages/product_detail_page.dart';
|
||||
import 'package:worker/features/products/presentation/pages/products_page.dart';
|
||||
@@ -84,6 +85,16 @@ class AppRouter {
|
||||
),
|
||||
),
|
||||
|
||||
// Favorites Route
|
||||
GoRoute(
|
||||
path: RouteNames.favorites,
|
||||
name: RouteNames.favorites,
|
||||
pageBuilder: (context, state) => MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: const FavoritesPage(),
|
||||
),
|
||||
),
|
||||
|
||||
// TODO: Add more routes as features are implemented
|
||||
],
|
||||
|
||||
@@ -165,6 +176,7 @@ class RouteNames {
|
||||
static const String products = '/products';
|
||||
static const String productDetail = '/products/:id';
|
||||
static const String cart = '/cart';
|
||||
static const String favorites = '/favorites';
|
||||
static const String checkout = '/checkout';
|
||||
static const String orderSuccess = '/order-success';
|
||||
|
||||
@@ -223,6 +235,9 @@ extension GoRouterExtension on BuildContext {
|
||||
/// Navigate to cart page
|
||||
void goCart() => go(RouteNames.cart);
|
||||
|
||||
/// Navigate to favorites page
|
||||
void goFavorites() => go(RouteNames.favorites);
|
||||
|
||||
/// Navigate to loyalty page
|
||||
void goLoyalty() => go(RouteNames.loyalty);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user