Offers And Discounts Complete

offers_discounts
Aamir Muhammad 1 month ago
parent 75a3578049
commit eb6a8680b6

@ -7,9 +7,11 @@ import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/offers_and_discounts/offers_and_discounts_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/offers_and_discounts/offers_and_discount_payment_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
@ -278,6 +280,14 @@ class _OfferAndDiscountsFullScreenSwiperPageState extends State<OfferAndDiscount
icon: AppAssets.shoppingCart,
iconColor: AppColors.whiteColor,
onPressed: () async {
if (!appState.isAuthenticated) {
getIt<DialogService>().showErrorBottomSheet(
message: LocaleKeys.loginToUseService.tr(),
onOkPressed: () {
Navigator.of(context).pop();
getIt<AuthenticationViewModel>().onLoginPressed();
});
} else {
// Ensure patient is authenticated (will re-authenticate if needed)
final isAuthenticated = await vm.ensureAuthenticated(
onSuccess: () {
@ -308,6 +318,7 @@ class _OfferAndDiscountsFullScreenSwiperPageState extends State<OfferAndDiscount
),
);
}
}
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,

Loading…
Cancel
Save