fix product

This commit is contained in:
Phuoc Nguyen
2025-11-17 15:07:53 +07:00
parent 0828ff1355
commit ff3629d6d1
14 changed files with 1087 additions and 110 deletions

View File

@@ -37,6 +37,7 @@ import 'package:worker/features/orders/presentation/pages/payments_page.dart';
import 'package:worker/features/price_policy/price_policy.dart';
import 'package:worker/features/products/presentation/pages/product_detail_page.dart';
import 'package:worker/features/products/presentation/pages/products_page.dart';
import 'package:worker/features/products/presentation/pages/write_review_page.dart';
import 'package:worker/features/promotions/presentation/pages/promotion_detail_page.dart';
import 'package:worker/features/quotes/presentation/pages/quotes_page.dart';
import 'package:worker/features/showrooms/presentation/pages/design_request_create_page.dart';
@@ -181,6 +182,20 @@ final routerProvider = Provider<GoRouter>((ref) {
child: ProductDetailPage(productId: productId ?? ''),
);
},
routes: [
// Write Review Route (nested under product detail)
GoRoute(
path: 'write-review',
name: RouteNames.writeReview,
pageBuilder: (context, state) {
final productId = state.pathParameters['id'];
return MaterialPage(
key: state.pageKey,
child: WriteReviewPage(productId: productId ?? ''),
);
},
),
],
),
// Promotion Detail Route
@@ -459,6 +474,7 @@ class RouteNames {
static const String home = '/';
static const String products = '/products';
static const String productDetail = '/products/:id';
static const String writeReview = 'write-review';
static const String cart = '/cart';
static const String favorites = '/favorites';
static const String checkout = '/checkout';