add promotion/detail
This commit is contained in:
@@ -6,8 +6,10 @@ library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/features/home/presentation/pages/home_page.dart';
|
||||
import 'package:worker/features/home/domain/entities/promotion.dart';
|
||||
import 'package:worker/features/main/presentation/pages/main_scaffold.dart';
|
||||
import 'package:worker/features/products/presentation/pages/products_page.dart';
|
||||
import 'package:worker/features/promotions/presentation/pages/promotion_detail_page.dart';
|
||||
|
||||
/// App Router
|
||||
///
|
||||
@@ -25,17 +27,17 @@ class AppRouter {
|
||||
|
||||
// Route definitions
|
||||
routes: [
|
||||
// Home Route
|
||||
// Main Route (with bottom navigation)
|
||||
GoRoute(
|
||||
path: RouteNames.home,
|
||||
name: RouteNames.home,
|
||||
pageBuilder: (context, state) => MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: const HomePage(),
|
||||
child: const MainScaffold(),
|
||||
),
|
||||
),
|
||||
|
||||
// Products Route
|
||||
// Products Route (full screen, no bottom nav)
|
||||
GoRoute(
|
||||
path: RouteNames.products,
|
||||
name: RouteNames.products,
|
||||
@@ -45,6 +47,19 @@ class AppRouter {
|
||||
),
|
||||
),
|
||||
|
||||
// Promotion Detail Route
|
||||
GoRoute(
|
||||
path: RouteNames.promotionDetail,
|
||||
name: RouteNames.promotionDetail,
|
||||
pageBuilder: (context, state) {
|
||||
final promotionId = state.pathParameters['id'];
|
||||
return MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: PromotionDetailPage(promotionId: promotionId),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
// TODO: Add more routes as features are implemented
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user