pickup direction bottom sheet added and previous radio bottom sheet removed

ambulance_selection_change
tahaalam 2 days ago
parent 9612b0019c
commit 8a11cc03cb

@ -1618,5 +1618,9 @@
"sortByLocation": "الترتيب حسب الموقع", "sortByLocation": "الترتيب حسب الموقع",
"timeForFirstReminder": "وقت التذكير الأول", "timeForFirstReminder": "وقت التذكير الأول",
"reminderRemovalNote": "يمكنك إزالتها من التقويم الخاص بك لاحقاً عن طريق إيقاف تشغيل التذكير", "reminderRemovalNote": "يمكنك إزالتها من التقويم الخاص بك لاحقاً عن طريق إيقاف تشغيل التذكير",
"communicationLanguage": "لغة التواصل" "communicationLanguage": "لغة التواصل",
"oneWaySubtitle": "نقل من الموقع إلى المستشفى",
"twoWaySubtitle": "نقل من الموقع إلى المستشفى والعودة مرة أخرى",
"toHospitalSubtitle": "نقل من موقعك الحالي إلى المستشفى",
"fromHospitalSubtitle": "نقل من المستشفى إلى منزلك"
} }

@ -1611,5 +1611,9 @@
"sortByLocation": "Sort by location", "sortByLocation": "Sort by location",
"sortByNearestLocation": "Sort by nearest to your location", "sortByNearestLocation": "Sort by nearest to your location",
"giveLocationPermissionForNearestList": "Please grant location permission from app settings to see the nearest locations.", "giveLocationPermissionForNearestList": "Please grant location permission from app settings to see the nearest locations.",
"communicationLanguage": "Communication Language" "communicationLanguage": "Communication Language",
"oneWaySubtitle": "Pickup from location to hospital",
"twoWaySubtitle": "Round trip from location to hospital and back",
"toHospitalSubtitle": "Transfer from your current location to the hospital",
"fromHospitalSubtitle": "Transfer from the hospital back to your home"
} }

@ -149,7 +149,7 @@ class EmergencyServicesRepoImp implements EmergencyServicesRepo {
GenericApiModel<List<PatientERTransportationMethod>>? apiResponse; GenericApiModel<List<PatientERTransportationMethod>>? apiResponse;
Failure? failure; Failure? failure;
await apiClient.get( await apiClient.get(
"$GET_ALL_TRANSPORTATIONS_RC?patientID=$id", "$GET_ALL_TRANSPORTATIONS_RC?patientID=1231755",
isRCService: true, isRCService: true,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;

@ -530,6 +530,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
void setTransportationOption(PatientERTransportationMethod item) { void setTransportationOption(PatientERTransportationMethod item) {
selectedTransportOption = item; selectedTransportOption = item;
notifyListeners();
} }
void updateCallingPlace(AmbulanceCallingPlace? value) { void updateCallingPlace(AmbulanceCallingPlace? value) {

@ -1597,6 +1597,7 @@ abstract class LocaleKeys {
static const timeFor = 'timeFor'; static const timeFor = 'timeFor';
static const hmgPolicies = 'hmgPolicies'; static const hmgPolicies = 'hmgPolicies';
static const darkMode = 'darkMode'; static const darkMode = 'darkMode';
static const featureComingSoonDescription = 'featureComingSoonDescription';
static const generateAiAnalysisResult = 'generateAiAnalysisResult'; static const generateAiAnalysisResult = 'generateAiAnalysisResult';
static const ratings = 'ratings'; static const ratings = 'ratings';
static const hmgPharmacyText = 'hmgPharmacyText'; static const hmgPharmacyText = 'hmgPharmacyText';
@ -1611,6 +1612,9 @@ abstract class LocaleKeys {
static const timeForFirstReminder = 'timeForFirstReminder'; static const timeForFirstReminder = 'timeForFirstReminder';
static const reminderRemovalNote = 'reminderRemovalNote'; static const reminderRemovalNote = 'reminderRemovalNote';
static const communicationLanguage = 'communicationLanguage'; static const communicationLanguage = 'communicationLanguage';
static const featureComingSoonDescription = 'featureComingSoonDescription'; static const oneWaySubtitle = 'oneWaySubtitle';
static const twoWaySubtitle = 'twoWaySubtitle';
static const toHospitalSubtitle = 'toHospitalSubtitle';
static const fromHospitalSubtitle = 'fromHospitalSubtitle';
} }

@ -0,0 +1,170 @@
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_export.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/emergency_services/emergency_services_view_model.dart';
import 'package:hmg_patient_app_new/features/emergency_services/models/AmbulanceCallingPlace.dart';
import 'package:hmg_patient_app_new/features/emergency_services/models/ambulance_direction.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/transport_option_Item.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:provider/provider.dart';
import '../../../../generated/locale_keys.g.dart' show LocaleKeys;
class WayPickup extends StatelessWidget {
final VoidCallback onTap;
const WayPickup({super.key, required this.onTap});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.selectWay.tr(context: context)
.toText24(color: AppColors.textColor, isBold: true),
SizedBox(
height: 16.h,
),
// LocaleKeys.selectDirection.tr(context: context)
// .toText16(color: AppColors.textColor, weight: FontWeight.w600),
// SizedBox(
// height: 12.h,
// ),
Column(
children: [
SizedBox(height: 12.h),
Column(
mainAxisAlignment: MainAxisAlignment.start,
spacing:8.h,
children: [
TransportOptionItem(
title: LocaleKeys.oneWay.tr(context: context),
subTitle: LocaleKeys.oneWaySubtitle.tr(context: context),
firstIcon: AppAssets.to_arrow,
middleIcon: AppAssets.to_arrow,
lastIcon: AppAssets.hospital,
shouldFlipIcon: true,
price: context.read<EmergencyServicesViewModel>().selectedTransportOption?.priceTotal?.toString()??"",
onTap: () {
context
.read<EmergencyServicesViewModel>()
.updateDirection( AmbulanceDirection.ONE_WAY);
onTap();
},
),
TransportOptionItem(
title: LocaleKeys.twoWay.tr(context: context),
subTitle: LocaleKeys.twoWaySubtitle.tr(context: context),
firstIcon: AppAssets.dual_arrow,
middleIcon: AppAssets.dual_arrow,
lastIcon: AppAssets.hospital,
price: ((context.read<EmergencyServicesViewModel>().selectedTransportOption?.priceTotal??0)*2).toString(),
onTap: () {
context
.read<EmergencyServicesViewModel>()
.updateDirection( AmbulanceDirection.TWO_WAY);
onTap();
},
),
// Visibility(
// visible: value == AmbulanceCallingPlace.TO_HOSPITAL,
// child: Selector<EmergencyServicesViewModel, AmbulanceDirection>(
// selector: (context, viewModel) => viewModel.ambulanceDirection,
// builder: (context, directionValue, _) {
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(height: 16.h),
// LocaleKeys.selectWay.tr(context: context)
// .toText16(color: AppColors.textColor, weight: FontWeight.w600),
// SizedBox(height: 12.h),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Expanded(
// child: Row(
// children: [
// Radio<AmbulanceDirection>(
// value: AmbulanceDirection.ONE_WAY,
// groupValue: directionValue,
// onChanged: (AmbulanceDirection? newValue) {
// if (newValue != null) {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(newValue);
// }
// },
// activeColor: AppColors.primaryRedColor,
// fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
// ),
// LocaleKeys.oneWay.tr(context: context)
// .toText12(color: AppColors.textColor, fontWeight: FontWeight.w500)
// ],
// ).onPress(() {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(AmbulanceDirection.ONE_WAY);
// }),
// ),
// Expanded(
// child: Row(
// children: [
// Radio<AmbulanceDirection>(
// value: AmbulanceDirection.TWO_WAY,
// groupValue: directionValue,
// onChanged: (AmbulanceDirection? newValue) {
// if (newValue != null) {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(newValue);
// }
// },
// activeColor: AppColors.primaryRedColor,
// fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
// ),
// LocaleKeys.twoWay.tr(context: context)
// .toText14(color: AppColors.textColor, weight: FontWeight.w500)
// ],
// ).onPress(() {
// context
//
// .read<EmergencyServicesViewModel>()
// .updateDirection(AmbulanceDirection.TWO_WAY);
// }),
// ),
// ],
// ),
// ],
// );
// },
// ),
],
),
],
),
// Selector<EmergencyServicesViewModel, AmbulanceCallingPlace>(
// selector: (context, viewModel) => viewModel.callingPlace,
// builder: (context, value, _) {
// return ;
// },
// ),
SizedBox(
height: 16.h,
),
// CustomButton(
// text: LocaleKeys.confirm.tr(context: context),
// onPressed: onTap,
// backgroundColor: AppColors.primaryRedColor,
// borderColor: AppColors.primaryRedColor,
// textColor: AppColors.whiteColor,
// iconColor: AppColors.whiteColor,
// ),
],
);
}
}

@ -29,7 +29,7 @@ class AmbulanceOptionSelectionBottomSheet extends StatelessWidget {
itemBuilder: (_, index) => TransportOptionItem( itemBuilder: (_, index) => TransportOptionItem(
title: Utils.getTextWRTCurrentLanguage(data[index].text, data[index].textN), title: Utils.getTextWRTCurrentLanguage(data[index].text, data[index].textN),
subTitle: "", subTitle: "",
firstIcon: AppAssets.location_pickup, firstIcon: AppAssets.ambulance,
middleIcon: AppAssets.to_arrow, middleIcon: AppAssets.to_arrow,
lastIcon: AppAssets.hospital, lastIcon: AppAssets.hospital,
price: data[index].priceTotal.toString(), price: data[index].priceTotal.toString(),

@ -1,11 +1,13 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart'; import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart';
import 'package:hmg_patient_app_new/features/emergency_services/models/AmbulanceCallingPlace.dart'; import 'package:hmg_patient_app_new/features/emergency_services/models/AmbulanceCallingPlace.dart';
import 'package:hmg_patient_app_new/features/emergency_services/models/ambulance_direction.dart'; import 'package:hmg_patient_app_new/features/emergency_services/models/ambulance_direction.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/transport_option_Item.dart';
import 'package:hmg_patient_app_new/theme/colors.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/buttons/custom_button.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -13,7 +15,7 @@ import 'package:provider/provider.dart';
import '../../../../generated/locale_keys.g.dart' show LocaleKeys; import '../../../../generated/locale_keys.g.dart' show LocaleKeys;
class PickupLocation extends StatelessWidget { class PickupLocation extends StatelessWidget {
final VoidCallback onTap; final Function(AmbulanceCallingPlace) onTap;
const PickupLocation({super.key, required this.onTap}); const PickupLocation({super.key, required this.onTap});
@override @override
@ -26,159 +28,189 @@ class PickupLocation extends StatelessWidget {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
LocaleKeys.selectDirection.tr(context: context) // LocaleKeys.selectDirection.tr(context: context)
.toText16(color: AppColors.textColor, weight: FontWeight.w600), // .toText16(color: AppColors.textColor, weight: FontWeight.w600),
SizedBox( // SizedBox(
height: 12.h, // height: 12.h,
), // ),
Selector<EmergencyServicesViewModel, AmbulanceCallingPlace>( Column(
selector: (context, viewModel) => viewModel.callingPlace, children: [
builder: (context, value, _) { SizedBox(height: 12.h),
return Column( Column(
mainAxisAlignment: MainAxisAlignment.start,
spacing:8.h,
children: [ children: [
SizedBox(height: 12.h), TransportOptionItem(
Row( title: LocaleKeys.toHospital.tr(context: context),
mainAxisAlignment: MainAxisAlignment.start, subTitle: LocaleKeys.toHospitalSubtitle.tr(context: context),
children: [ firstIcon: AppAssets.homeBottomFill,
Expanded( middleIcon: AppAssets.to_arrow,
child: Row( lastIcon: AppAssets.hospital,
children: [ price: context.read<EmergencyServicesViewModel>().selectedTransportOption?.priceTotal?.toString()??"",
Radio<AmbulanceCallingPlace>( onTap: () {
value: AmbulanceCallingPlace.TO_HOSPITAL, context.read<EmergencyServicesViewModel>()
groupValue: value, .updateCallingPlace(AmbulanceCallingPlace.TO_HOSPITAL);
onChanged: (AmbulanceCallingPlace? newValue) { onTap(AmbulanceCallingPlace.TO_HOSPITAL);
if (newValue != null) { },
context
.read<EmergencyServicesViewModel>()
.updateCallingPlace(newValue);
}
},
activeColor: AppColors.primaryRedColor,
fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
),
LocaleKeys.toHospital.tr(context: context)
.toText14(color: AppColors.textColor, weight: FontWeight.w500)
],
).onPress(() {
context
.read<EmergencyServicesViewModel>()
.updateCallingPlace(AmbulanceCallingPlace.TO_HOSPITAL);
}),
),
Expanded(
child: Row(
children: [
Radio<AmbulanceCallingPlace>(
value: AmbulanceCallingPlace.FROM_HOSPITAL,
groupValue: value,
onChanged: (AmbulanceCallingPlace? newValue) {
if (newValue != null) {
context
.read<EmergencyServicesViewModel>()
.updateCallingPlace(newValue);
}
},
activeColor: AppColors.primaryRedColor,
fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
),
LocaleKeys.fromHospital.tr(context: context)
.toText14(color: AppColors.textColor, weight: FontWeight.w500)
],
).onPress(() {
context
.read<EmergencyServicesViewModel>()
.updateCallingPlace(AmbulanceCallingPlace.FROM_HOSPITAL);
}),
),
],
), ),
Visibility(
visible: value == AmbulanceCallingPlace.TO_HOSPITAL, TransportOptionItem(
child: Selector<EmergencyServicesViewModel, AmbulanceDirection>( title: LocaleKeys.fromHospital.tr(context: context),
selector: (context, viewModel) => viewModel.ambulanceDirection, subTitle: LocaleKeys.fromHospitalSubtitle.tr(context: context),
builder: (context, directionValue, _) { firstIcon: AppAssets.hospital,
return Column( middleIcon: AppAssets.to_arrow,
crossAxisAlignment: CrossAxisAlignment.start, lastIcon: AppAssets.hospital,
children: [ price: context.read<EmergencyServicesViewModel>().selectedTransportOption?.priceTotal?.toString()??"",
SizedBox(height: 16.h), onTap: () {
LocaleKeys.selectWay.tr(context: context) context.read<EmergencyServicesViewModel>().updateCallingPlace(AmbulanceCallingPlace.FROM_HOSPITAL);
.toText16(color: AppColors.textColor, weight: FontWeight.w600), onTap(AmbulanceCallingPlace.FROM_HOSPITAL);
SizedBox(height: 12.h), },
Row( ),
mainAxisAlignment: MainAxisAlignment.start, // Expanded(
children: [ // child: Row(
Expanded( // children: [
child: Row( // Radio<AmbulanceCallingPlace>(
children: [ // value: AmbulanceCallingPlace.TO_HOSPITAL,
Radio<AmbulanceDirection>( // groupValue: value,
value: AmbulanceDirection.ONE_WAY, // onChanged: (AmbulanceCallingPlace? newValue) {
groupValue: directionValue, // if (newValue != null) {
onChanged: (AmbulanceDirection? newValue) { // context
if (newValue != null) { // .read<EmergencyServicesViewModel>()
context // .updateCallingPlace(newValue);
.read<EmergencyServicesViewModel>() // }
.updateDirection(newValue); // },
} // activeColor: AppColors.primaryRedColor,
}, // fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
activeColor: AppColors.primaryRedColor, // ),
fillColor: MaterialStateProperty.all(AppColors.primaryRedColor), // LocaleKeys.toHospital.tr(context: context)
), // .toText14(color: AppColors.textColor, weight: FontWeight.w500)
LocaleKeys.oneWay.tr(context: context) // ],
.toText12(color: AppColors.textColor, fontWeight: FontWeight.w500) // ).onPress(() {
], // context
).onPress(() { // .read<EmergencyServicesViewModel>()
context // .updateCallingPlace(AmbulanceCallingPlace.TO_HOSPITAL);
.read<EmergencyServicesViewModel>() // }),
.updateDirection(AmbulanceDirection.ONE_WAY); // ),
}), // Expanded(
), // child: Row(
Expanded( // children: [
child: Row( // Radio<AmbulanceCallingPlace>(
children: [ // value: AmbulanceCallingPlace.FROM_HOSPITAL,
Radio<AmbulanceDirection>( // groupValue: value,
value: AmbulanceDirection.TWO_WAY, // onChanged: (AmbulanceCallingPlace? newValue) {
groupValue: directionValue, // if (newValue != null) {
onChanged: (AmbulanceDirection? newValue) { // context
if (newValue != null) { // .read<EmergencyServicesViewModel>()
context // .updateCallingPlace(newValue);
.read<EmergencyServicesViewModel>() // }
.updateDirection(newValue); // },
} // activeColor: AppColors.primaryRedColor,
}, // fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
activeColor: AppColors.primaryRedColor, // ),
fillColor: MaterialStateProperty.all(AppColors.primaryRedColor), // LocaleKeys.fromHospital.tr(context: context)
), // .toText14(color: AppColors.textColor, weight: FontWeight.w500)
LocaleKeys.twoWay.tr(context: context) // ],
.toText14(color: AppColors.textColor, weight: FontWeight.w500) // ).onPress(() {
], // context
).onPress(() { // .read<EmergencyServicesViewModel>()
context // .updateCallingPlace(AmbulanceCallingPlace.FROM_HOSPITAL);
.read<EmergencyServicesViewModel>() // }),
.updateDirection(AmbulanceDirection.TWO_WAY); // ),
}), // ],
), // ),
], // Visibility(
), // visible: value == AmbulanceCallingPlace.TO_HOSPITAL,
], // child: Selector<EmergencyServicesViewModel, AmbulanceDirection>(
); // selector: (context, viewModel) => viewModel.ambulanceDirection,
}, // builder: (context, directionValue, _) {
), // return Column(
) // crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// SizedBox(height: 16.h),
// LocaleKeys.selectWay.tr(context: context)
// .toText16(color: AppColors.textColor, weight: FontWeight.w600),
// SizedBox(height: 12.h),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Expanded(
// child: Row(
// children: [
// Radio<AmbulanceDirection>(
// value: AmbulanceDirection.ONE_WAY,
// groupValue: directionValue,
// onChanged: (AmbulanceDirection? newValue) {
// if (newValue != null) {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(newValue);
// }
// },
// activeColor: AppColors.primaryRedColor,
// fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
// ),
// LocaleKeys.oneWay.tr(context: context)
// .toText12(color: AppColors.textColor, fontWeight: FontWeight.w500)
// ],
// ).onPress(() {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(AmbulanceDirection.ONE_WAY);
// }),
// ),
// Expanded(
// child: Row(
// children: [
// Radio<AmbulanceDirection>(
// value: AmbulanceDirection.TWO_WAY,
// groupValue: directionValue,
// onChanged: (AmbulanceDirection? newValue) {
// if (newValue != null) {
// context
// .read<EmergencyServicesViewModel>()
// .updateDirection(newValue);
// }
// },
// activeColor: AppColors.primaryRedColor,
// fillColor: MaterialStateProperty.all(AppColors.primaryRedColor),
// ),
// LocaleKeys.twoWay.tr(context: context)
// .toText14(color: AppColors.textColor, weight: FontWeight.w500)
// ],
// ).onPress(() {
// context
//
// .read<EmergencyServicesViewModel>()
// .updateDirection(AmbulanceDirection.TWO_WAY);
// }),
// ),
// ],
// ),
// ],
// );
// },
// ),
], ],
); ),
}, ],
), ),
// Selector<EmergencyServicesViewModel, AmbulanceCallingPlace>(
// selector: (context, viewModel) => viewModel.callingPlace,
// builder: (context, value, _) {
// return ;
// },
// ),
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
CustomButton( // CustomButton(
text: LocaleKeys.confirm.tr(context: context), // text: LocaleKeys.confirm.tr(context: context),
onPressed: onTap, // onPressed: onTap,
backgroundColor: AppColors.primaryRedColor, // backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor, // borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor, // textColor: AppColors.whiteColor,
iconColor: AppColors.whiteColor, // iconColor: AppColors.whiteColor,
), // ),
], ],
); );
} }

@ -1,11 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/utils/size_utils.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/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.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/buttons/custom_button.dart';
import 'package:provider/provider.dart';
class TransportOptionItem extends StatelessWidget { class TransportOptionItem extends StatelessWidget {
final String title; final String title;
@ -15,6 +18,7 @@ class TransportOptionItem extends StatelessWidget {
final String lastIcon; final String lastIcon;
final String price; final String price;
final VoidCallback onTap; final VoidCallback onTap;
final bool shouldFlipIcon;
const TransportOptionItem( const TransportOptionItem(
{super.key, {super.key,
@ -24,6 +28,7 @@ class TransportOptionItem extends StatelessWidget {
required this.middleIcon, required this.middleIcon,
required this.lastIcon, required this.lastIcon,
required this.price, required this.price,
this.shouldFlipIcon = false,
required this.onTap}); required this.onTap});
@override @override
@ -39,14 +44,14 @@ class TransportOptionItem extends StatelessWidget {
spacing: 16.h, spacing: 16.h,
children: [ children: [
headerSection(), headerSection(),
titleSection(), titleSection(context),
], ],
)).onPress((){ )).onPress((){
onTap(); onTap();
}); });
} }
titleSection() { titleSection(BuildContext context) {
return Row( return Row(
children: [ children: [
Expanded( Expanded(
@ -55,13 +60,11 @@ class TransportOptionItem extends StatelessWidget {
children: [ children: [
title.toText16( title.toText16(
color: AppColors.textColor, weight: FontWeight.w600), color: AppColors.textColor, weight: FontWeight.w600),
// subTitle.toText12( subTitle.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
// color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
Utils.buildSvgWithAssets( Transform.flip(flipX: getIt.get<AppState>().isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_medium, width: 24.h, height: 24.h))
icon: AppAssets.forward_arrow_medium, width: 24.h, height: 24.h)
], ],
); );
} }
@ -70,20 +73,19 @@ class TransportOptionItem extends StatelessWidget {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
// Expanded( Expanded(
// child: Row( child: Row(
// children: [ children: [
// buildIcon(firstIcon), Transform.flip(flipX: getIt.get<AppState>().isArabic() && shouldFlipIcon, child: buildIcon(firstIcon)),
// Utils.buildSvgWithAssets( // Utils.buildSvgWithAssets(
// icon: middleIcon, width: 24.h, height: 24.h).paddingAll(8.h), // icon: middleIcon, width: 24.h, height: 24.h).paddingAll(8.h),
// buildIcon(lastIcon) // buildIcon(lastIcon)
// ], ],
// ), ),
// ), ),
Utils.getPaymentAmountWithSymbol2( Visibility(
num.tryParse(price) ?? 0.0, visible: price.isNotEmpty,
fontSize: 18.f, child: Utils.getPaymentAmountWithSymbol2(num.tryParse(price) ?? 0.0, fontSize: 18.f, letterSpacing: -2),
letterSpacing:-2
), ),
], ],
); );
@ -98,7 +100,7 @@ class TransportOptionItem extends StatelessWidget {
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
iconColor: AppColors.greyTextColor, iconColor: AppColors.greyTextColor,
borderColor: Colors.transparent, borderColor: Colors.transparent,
height: 40.h, height: 42.h,
); );
} }
} }

@ -12,6 +12,7 @@ import 'package:hmg_patient_app_new/features/emergency_services/models/OrderDisp
import 'package:hmg_patient_app_new/features/location/location_view_model.dart'; import 'package:hmg_patient_app_new/features/location/location_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/RRT/rrt_request_type_select.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/RRT/rrt_request_type_select.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/WayPickup.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/ambulance_option_selection_bottomsheet.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/ambulance_option_selection_bottomsheet.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/pickup_location.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/pickup_location.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/er_online_checkin/er_online_checkin_home.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/er_online_checkin/er_online_checkin_home.dart';
@ -26,6 +27,8 @@ import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:lottie/lottie.dart'; import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../features/emergency_services/models/AmbulanceCallingPlace.dart' show AmbulanceCallingPlace;
class EmergencyServicesPage extends StatefulWidget { class EmergencyServicesPage extends StatefulWidget {
EmergencyServicesPage({super.key}); EmergencyServicesPage({super.key});
@ -440,7 +443,42 @@ class _EmergencyServicesPageState extends State<EmergencyServicesPage> {
openTranportationSelectionBottomSheet(context); openTranportationSelectionBottomSheet(context);
}), }),
context, context,
child: PickupLocation(onTap: () { child: PickupLocation(onTap: (fromLocation) {
Navigator.of(context).pop();
if(fromLocation == AmbulanceCallingPlace.TO_HOSPITAL){
openNumberWayOfSelectionBottomSheet(context);
return;
}
context.read<LocationViewModel>().flushSearchPredictions();
context.read<EmergencyServicesViewModel>().navigateTOAmbulancePage();
}),
isFullScreen: false,
isCloseButtonVisible: true,
hasBottomPadding: false,
backgroundColor: AppColors.bottomSheetBgColor,
callBackFunc: () {},
);
}
openNumberWayOfSelectionBottomSheet(BuildContext context) {
showCommonBottomSheetWithoutHeight(
onCloseClicked: () {
context.read<EmergencyServicesViewModel>().flushPickupInformation();
},
titleWidget: Transform.flip(
flipX: emergencyServicesViewModel.isArabic,
child: Utils.buildSvgWithAssets(
icon: AppAssets.arrow_back,
iconColor: Color(0xff2B353E),
fit: BoxFit.contain,
),
).onPress(() {
context.read<EmergencyServicesViewModel>().flushPickupInformation();
Navigator.pop(context);
openPickupDetailsBottomSheet(context);
}),
context,
child: WayPickup(onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
context.read<LocationViewModel>().flushSearchPredictions(); context.read<LocationViewModel>().flushSearchPredictions();
context.read<EmergencyServicesViewModel>().navigateTOAmbulancePage(); context.read<EmergencyServicesViewModel>().navigateTOAmbulancePage();

@ -8,7 +8,7 @@ class AppColors {
static const transparent = Colors.transparent; static const transparent = Colors.transparent;
// Scaffold / Background // Scaffold / Background
static Color get scaffoldBgColor => isDarkMode ? dark.scaffoldBgColor : const Color(0xFFF0F0F0); static Color get scaffoldBgColor => isDarkMode ? dark.scaffoldBgColor : const Color(0xFFF8F8F8);
static Color get bottomSheetBgColor => isDarkMode ? dark.bottomSheetBgColor : const Color(0xFFF8F8FA); static Color get bottomSheetBgColor => isDarkMode ? dark.bottomSheetBgColor : const Color(0xFFF8F8FA);
static Color get lightGreyEFColor => isDarkMode ? dark.lightGreyEFColor : const Color(0xffeaeaff); static Color get lightGreyEFColor => isDarkMode ? dark.lightGreyEFColor : const Color(0xffeaeaff);
static Color get greyF7Color => isDarkMode ? dark.greyF7Color : const Color(0xffF7F7F7); static Color get greyF7Color => isDarkMode ? dark.greyF7Color : const Color(0xffF7F7F7);

Loading…
Cancel
Save