import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; 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/location_util.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/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart'; import 'package:hmg_patient_app_new/features/contact_us/models/feedback_type.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/find_us_page.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/live_chat_page.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; class ContactUs extends StatelessWidget { ContactUs({super.key}); late AppState appState; late ContactUsViewModel contactUsViewModel; late LocationUtils locationUtils; @override Widget build(BuildContext context) { appState = getIt.get(); locationUtils = getIt.get(); locationUtils.isShowConfirmDialog = true; contactUsViewModel = Provider.of(context); return Column( children: [ checkInOptionCard( AppAssets.checkin_location_icon, LocaleKeys.findUs.tr(), LocaleKeys.viewNearestHMGLocations.tr(), ).onPress(() { locationUtils.getCurrentLocation(onSuccess: (value) { contactUsViewModel.initContactUsViewModel(); Navigator.pop(context); Navigator.of(context).push( CustomPageRoute( page: FindUsPage(), ), ); }); }), SizedBox(height: 16.h), checkInOptionCard( AppAssets.checkin_location_icon, LocaleKeys.feedback.tr(), LocaleKeys.provideFeedbackOnServices.tr(), ).onPress(() { contactUsViewModel.setSelectedFeedbackType( FeedbackType(id: 5, nameEN: "Not classified", nameAR: 'غير محدد'), ); Navigator.pop(context); Navigator.of(context).push( CustomPageRoute( page: FeedbackPage(), ), ); }), SizedBox(height: 16.h), checkInOptionCard( AppAssets.checkin_location_icon, LocaleKeys.liveChat.tr(), LocaleKeys.liveChatWithHMG.tr(), ).onPress(() { locationUtils.getCurrentLocation(onSuccess: (value) { contactUsViewModel.getLiveChatProjectsList(); Navigator.pop(context); Navigator.of(context).push( CustomPageRoute( page: LiveChatPage(), ), ); }); }), ], ); } Widget checkInOptionCard(String icon, String title, String subTitle) { return Container( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( color: AppColors.whiteColor, borderRadius: 20.r, hasShadow: false, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Utils.buildSvgWithAssets(icon: icon, width: 40.h, height: 40.h, fit: BoxFit.fill), SizedBox(height: 16.h), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ title.toText16(isBold: true, color: AppColors.textColor), subTitle.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), ], ), ), Transform.flip( flipX: appState.isArabic(), child: Utils.buildSvgWithAssets( icon: AppAssets.forward_arrow_icon_small, iconColor: AppColors.blackColor, width: 18.h, height: 13.h, fit: BoxFit.contain, ), ), ], ), ], ).paddingAll(16.h), ); } }