add promotion/detail
This commit is contained in:
@@ -6,6 +6,8 @@ library;
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/core/router/app_router.dart';
|
||||
import 'package:worker/core/theme/colors.dart';
|
||||
import 'package:worker/features/home/domain/entities/promotion.dart';
|
||||
|
||||
@@ -58,9 +60,17 @@ class PromotionSlider extends StatelessWidget {
|
||||
itemBuilder: (context, index) {
|
||||
return _PromotionCard(
|
||||
promotion: promotions[index],
|
||||
onTap: onPromotionTap != null
|
||||
? () => onPromotionTap!(promotions[index])
|
||||
: null,
|
||||
onTap: () {
|
||||
if (onPromotionTap != null) {
|
||||
onPromotionTap!(promotions[index]);
|
||||
} else {
|
||||
// Navigate to promotion detail page
|
||||
context.pushNamed(
|
||||
RouteNames.promotionDetail,
|
||||
extra: promotions[index],
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user