updates & fixes & RRT Flow

dev_aamir
aamir-csol 1 day ago
parent 3e5c3a3a27
commit e113c4c1ee

@ -2,6 +2,8 @@ import Flutter
import UIKit import UIKit
import FirebaseCore import FirebaseCore
import FirebaseMessaging import FirebaseMessaging
import GoogleMaps
@main @main
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
@ -10,6 +12,7 @@ import FirebaseMessaging
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
FirebaseApp.configure() FirebaseApp.configure()
GMSServices.provideAPIKey("AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA")
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }

@ -729,7 +729,7 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -158,7 +158,8 @@ class AppDependencies {
); );
getIt.registerLazySingleton<BookAppointmentsViewModel>( getIt.registerLazySingleton<BookAppointmentsViewModel>(
() => BookAppointmentsViewModel(bookAppointmentsRepo: getIt(), errorHandlerService: getIt(), navigationService: getIt(), myAppointmentsViewModel: getIt(), locationUtils: getIt(), dialogService: getIt()), () => BookAppointmentsViewModel(
bookAppointmentsRepo: getIt(), errorHandlerService: getIt(), navigationService: getIt(), myAppointmentsViewModel: getIt(), locationUtils: getIt(), dialogService: getIt()),
); );
getIt.registerLazySingleton<ImmediateLiveCareViewModel>( getIt.registerLazySingleton<ImmediateLiveCareViewModel>(
@ -185,8 +186,7 @@ class AppDependencies {
); );
getIt.registerLazySingleton<AppointmentViaRegionViewmodel>( getIt.registerLazySingleton<AppointmentViaRegionViewmodel>(
() => () => AppointmentViaRegionViewmodel(
AppointmentViaRegionViewmodel(
navigationService: getIt(), navigationService: getIt(),
appState: getIt(), appState: getIt(),
), ),

@ -101,10 +101,7 @@ class AuthenticationRepoImp implements AuthenticationRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<dynamic>>> checkPatientAuthentication({ Future<Either<Failure, GenericApiModel<dynamic>>> checkPatientAuthentication({required dynamic checkPatientAuthenticationReq, String? languageID}) async {
required dynamic checkPatientAuthenticationReq,
String? languageID,
}) async {
int isOutKsa = (checkPatientAuthenticationReq.zipCode == '966' || checkPatientAuthenticationReq.zipCode == '+966') ? 0 : 1; int isOutKsa = (checkPatientAuthenticationReq.zipCode == '966' || checkPatientAuthenticationReq.zipCode == '+966') ? 0 : 1;
checkPatientAuthenticationReq.patientOutSA = isOutKsa; checkPatientAuthenticationReq.patientOutSA = isOutKsa;
try { try {
@ -149,7 +146,6 @@ class AuthenticationRepoImp implements AuthenticationRepo {
sendActivationCodeReq.isDentalAllowedBackend = false; sendActivationCodeReq.isDentalAllowedBackend = false;
final payload = sendActivationCodeReq.toJson(); final payload = sendActivationCodeReq.toJson();
if (isFormFamilyFile) { if (isFormFamilyFile) {
payload.remove("MobileNo"); payload.remove("MobileNo");
payload.remove("NationalID"); payload.remove("NationalID");
payload.remove("SMSSignature"); payload.remove("SMSSignature");

@ -851,16 +851,13 @@ class AuthenticationViewModel extends ChangeNotifier {
request['isRegister'] = true; request['isRegister'] = true;
_appState.setAppAuthToken = response['LogInTokenID']; _appState.setAppAuthToken = response['LogInTokenID'];
if (isPatientOutsideSA(request: response)) { if (isPatientOutsideSA(request: response)) {
print("=======OUT SA=======");
sendActivationCode( sendActivationCode(
otpTypeEnum: OTPTypeEnumExtension.fromInt(request["OTP_SendType"]), otpTypeEnum: OTPTypeEnumExtension.fromInt(request["OTP_SendType"]),
nationalIdOrFileNumber: request["PatientIdentificationID"].toString(), nationalIdOrFileNumber: request["PatientIdentificationID"].toString(),
phoneNumber: request["PatientMobileNumber"].toString(), phoneNumber: request["PatientMobileNumber"].toString(),
payload: request, payload: request,
isForRegister: true, isForRegister: true);
);
} else { } else {
print("=======IN SA=======");
chekUserNHICData(request: request); chekUserNHICData(request: request);
} }
} }

@ -25,6 +25,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
final LocationUtils? locationUtils; final LocationUtils? locationUtils;
final AppState appState; final AppState appState;
bool isERListLoading = false; bool isERListLoading = false;
bool isTermsAccepted = false;
List<ProjectAvgERWaitingTime> nearestERList = []; List<ProjectAvgERWaitingTime> nearestERList = [];
List<ProjectAvgERWaitingTime> nearestERFilteredList = []; List<ProjectAvgERWaitingTime> nearestERFilteredList = [];
@ -47,11 +48,14 @@ class EmergencyServicesViewModel extends ChangeNotifier {
required this.appState, required this.appState,
}); });
get isGMSAvailable get isGMSAvailable {
{
return appState.isGMSAvailable; return appState.isGMSAvailable;
} }
void onTermAccepted() {
isTermsAccepted = !isTermsAccepted;
notifyListeners();
}
Future<void> getRRTProcedures({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getRRTProcedures({Function(dynamic)? onSuccess, Function(String)? onError}) async {
RRTProceduresList.clear(); RRTProceduresList.clear();
@ -89,6 +93,10 @@ class EmergencyServicesViewModel extends ChangeNotifier {
}); });
} }
void moveToNextStep() {
navServices.push(CustomPageRoute(page: CallAmbulancePage(isFromRRT: true)));
}
void filterErList(String query) { void filterErList(String query) {
print("the query is $query"); print("the query is $query");
if (query.isEmpty) { if (query.isEmpty) {
@ -149,8 +157,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
} }
GMSMapServices.CameraPosition getGMSLocation() { GMSMapServices.CameraPosition getGMSLocation() {
return GMSMapServices.CameraPosition( return GMSMapServices.CameraPosition(target: GMSMapServices.LatLng(appState.userLat, appState.userLong), zoom: 18);
target: GMSMapServices.LatLng(appState.userLat, appState.userLong), zoom: 18);
} }
handleGMSMapCameraMoved(GMSMapServices.CameraPosition value) { handleGMSMapCameraMoved(GMSMapServices.CameraPosition value) {
@ -158,9 +165,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
} }
HMSCameraServices.CameraPosition getHMSLocation() { HMSCameraServices.CameraPosition getHMSLocation() {
return HMSCameraServices.CameraPosition( return HMSCameraServices.CameraPosition(target: HMSCameraServices.LatLng(appState.userLat, appState.userLong), zoom: 18);
target: HMSCameraServices.LatLng(appState.userLat, appState.userLong),zoom: 18);
} }
handleHMSMapCameraMoved(HMSCameraServices.CameraPosition value) { handleHMSMapCameraMoved(HMSCameraServices.CameraPosition value) {
@ -173,11 +178,8 @@ class EmergencyServicesViewModel extends ChangeNotifier {
onSuccess: (position) { onSuccess: (position) {
updateBottomSheetState(BottomSheetType.FIXED); updateBottomSheetState(BottomSheetType.FIXED);
navServices.push( navServices.push(
CustomPageRoute( CustomPageRoute(page: CallAmbulancePage(), direction: AxisDirection.down),
page: CallAmbulancePage(), direction: AxisDirection.down
),
); );
}); });
} }
@ -187,8 +189,6 @@ class EmergencyServicesViewModel extends ChangeNotifier {
} }
void setIsGMSAvailable(bool value) { void setIsGMSAvailable(bool value) {
notifyListeners(); notifyListeners();
} }
} }

@ -59,7 +59,6 @@ class MedicalFileViewModel extends ChangeNotifier {
_selectedFamilyFileTabIndex = value; _selectedFamilyFileTabIndex = value;
notifyListeners(); notifyListeners();
} }
} }
static final DialogService _dialogService = getIt.get<DialogService>(); static final DialogService _dialogService = getIt.get<DialogService>();
@ -486,6 +485,13 @@ class MedicalFileViewModel extends ChangeNotifier {
}); });
} }
Future<void> clearAuthValues() async {
authVM.nationalIdController.clear();
authVM.phoneNumberController.clear();
authVM.emailController.clear();
authVM.dobController.clear();
}
Future<void> handleFamilyFileRequestOTPVerification() async { Future<void> handleFamilyFileRequestOTPVerification() async {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
if (!_appState.getIsChildLoggedIn) { if (!_appState.getIsChildLoggedIn) {

@ -1,9 +1,18 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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/core/dependencies.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/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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/call_ambulance_page.dart';
import 'package:hmg_patient_app_new/services/navigation_service.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/radio/custom_radio_button.dart'; import 'package:hmg_patient_app_new/widgets/radio/custom_radio_button.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -13,32 +22,160 @@ class RrtRequestTypeSelect extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// return Consumer<EmergencyServicesViewModel>(builder: (context, emergencyServicesVM, child) { // return Consumer<EmergencyServicesViewModel>(builder: (context, emergencyServicesVM, child) {
// NavigationService navService = getIt<NavigationService>();
// EmergencyServicesViewModel erServiceVm = Provider.of<EmergencyServicesViewModel>(context);
return Column( return Column(
children: [ children: [
Padding(
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
child: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRadioOption(value: "", groupValue: "", onChanged: (value) {}, text: "Home Visit Emergency".needTranslation).paddingSymmetrical(16, 24),
Divider(height: 1, color: Color(0xFFD2D2D2).withValues(alpha: 0.3)).paddingSymmetrical(16, 0),
CustomRadioOption(value: "", groupValue: "", onChanged: (value) {}, text: "COVID-19 (24 Hour) Home Visit".needTranslation).paddingSymmetrical(16, 24),
Divider(height: 1, color: Color(0xFFD2D2D2).withValues(alpha: 0.3)).paddingSymmetrical(16, 0),
CustomRadioOption(value: "", groupValue: "", onChanged: (value) {}, text: "COVID-19 (6 Hour) Home Visit".needTranslation).paddingSymmetrical(16, 24),
],
),
),
),
Padding(
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
child: GestureDetector(
onTap: context.read<EmergencyServicesViewModel>().onTermAccepted,
child: Row(
children: [
Selector<EmergencyServicesViewModel, bool>(
selector: (_, vm) => vm.isTermsAccepted,
shouldRebuild: (previous, next) => previous != next,
builder: (context, isTermsAccepted, child) {
return AnimatedContainer(
duration: const Duration(milliseconds: 200),
height: 24.h,
width: 24.h,
decoration: BoxDecoration(
color: isTermsAccepted ? AppColors.primaryRedColor : Colors.transparent,
borderRadius: BorderRadius.circular(6),
border: Border.all(color: isTermsAccepted ? AppColors.primaryRedBorderColor : AppColors.greyColor, width: 2.h),
),
child: isTermsAccepted ? Icon(Icons.check, size: 16.f, color: Colors.white) : null,
);
},
),
SizedBox(width: 12.h),
Row(
children: [
Text(
LocaleKeys.iAcceptThe.tr(),
style: context.dynamicTextStyle(fontSize: 14.f, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
),
GestureDetector(
onTap: () {
// Navigate to terms and conditions page
Navigator.of(context).pushNamed('/terms');
},
child: Text(
LocaleKeys.termsConditoins.tr(),
style: context.dynamicTextStyle(
fontSize: 14.f, fontWeight: FontWeight.w500, color: AppColors.primaryRedColor, decoration: TextDecoration.underline, decorationColor: AppColors.primaryRedBorderColor),
),
),
],
),
],
),
),
),
Container( Container(
padding: EdgeInsets.all(16.h),
height: 200.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 24.h, borderRadius: 24.h,
hasShadow: true,
), ),
child: Column( child: SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
children: [ // if (widget.patientAppointmentHistoryResponseModel.nextAction == 15 || widget.patientAppointmentHistoryResponseModel.nextAction == 20)
CustomRadioOption( Column(
value: "", crossAxisAlignment: CrossAxisAlignment.start,
groupValue: "", children: [
onChanged: (value) {}, Row(
text: "Home Visit Emergency", mainAxisAlignment: MainAxisAlignment.spaceBetween,
) children: [
], "Total amount to pay".needTranslation.toText18(isBold: true),
), Utils.getPaymentAmountWithSymbol("1000".toString().toText16(isBold: true), AppColors.blackColor, 13, isSaudiCurrency: true),
], ],
),
SizedBox(height: 4.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: "Amount will be paid at the hospital".toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor)),
"VAT 15%(${150})".needTranslation.toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -2),
],
),
SizedBox(height: 18.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 150.h,
child: Utils.getPaymentMethods(),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Utils.getPaymentAmountWithSymbol("1,150".toString().toText24(isBold: true), AppColors.blackColor, 17, isSaudiCurrency: true),
],
),
],
)
],
).paddingOnly(left: 16.h, top: 24.h, right: 16.h, bottom: 0.h),
// AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)
CustomButton(
text: LocaleKeys.next.tr(),
onPressed: () {
// navService.pop();
context.read<EmergencyServicesViewModel>().moveToNextStep();
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
iconColor: AppColors.whiteColor,
iconSize: 18.h,
).paddingSymmetrical(16.h, 24.h)
// : CustomButton(
// text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
// onPressed: () {
// myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
// handleAppointmentNextAction(widget.patientAppointmentHistoryResponseModel.nextAction);
// },
// backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction),
// borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
// textColor: widget.patientAppointmentHistoryResponseModel.nextAction == 15 ? AppColors.textColor : AppColors.whiteColor,
// fontSize: 16,
// fontWeight: FontWeight.w500,
// borderRadius: 12,
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
// height: 50.h,
// icon: AppointmentType.getNextActionIcon(widget.patientAppointmentHistoryResponseModel.nextAction),
// iconColor: AppColors.whiteColor,
// iconSize: 18.h,
// ).paddingSymmetrical(16.h, 24.h),
],
),
), ),
), ),
SizedBox(height: 32.h),
], ],
); );
// }); // });

@ -2,6 +2,7 @@ import 'dart:io';
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:google_places_flutter/model/prediction.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_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
@ -26,40 +27,38 @@ import 'package:provider/provider.dart';
import '../../../widgets/common_bottom_sheet.dart'; import '../../../widgets/common_bottom_sheet.dart';
import 'widgets/AddressItem.dart'; import 'widgets/AddressItem.dart';
class CallAmbulancePage extends StatelessWidget { class CallAmbulancePage extends StatefulWidget {
bool? isFromRRT;
CallAmbulancePage({super.key, this.isFromRRT = false});
@override
State<CallAmbulancePage> createState() => _CallAmbulancePageState();
}
class _CallAmbulancePageState extends State<CallAmbulancePage> {
TextEditingController addressController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
bottomSheet: ExpandableBottomSheet( bottomSheet: ExpandableBottomSheet(
bottomSheetType: bottomSheetType: context.watch<EmergencyServicesViewModel>().bottomSheetType,
context.watch<EmergencyServicesViewModel>().bottomSheetType,
children: { children: {
BottomSheetType.EXPANDED: ExpanedBottomSheet(context), BottomSheetType.EXPANDED: expandedBottomSheet(context),
BottomSheetType.FIXED: FixedBottomSheet(context), BottomSheetType.FIXED: fixedBottomSheet(context),
}, },
), ),
body: Stack( body: Stack(
children: [ children: [
if (context.read<EmergencyServicesViewModel>().isGMSAvailable || if (context.read<EmergencyServicesViewModel>().isGMSAvailable || Platform.isIOS)
Platform.isIOS) GMSMap(currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(), onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value))
GMSMap(
currentLocation:
context.read<EmergencyServicesViewModel>().getGMSLocation(),
onCameraMoved: (value) => context
.read<EmergencyServicesViewModel>()
.handleGMSMapCameraMoved(value))
else else
HMSMap( HMSMap(currentLocation: context.read<EmergencyServicesViewModel>().getHMSLocation(), onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleHMSMapCameraMoved(value)),
currentLocation:
context.read<EmergencyServicesViewModel>().getHMSLocation(),
onCameraMoved: (value) => context
.read<EmergencyServicesViewModel>()
.handleHMSMapCameraMoved(value)),
Align( Align(
alignment: AlignmentDirectional.topStart, alignment: AlignmentDirectional.topStart,
child: Utils.buildSvgWithAssets( child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h),
icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h), ).paddingOnly(top: 51.h, left: 24.h).onPress(() {
).paddingOnly(top: 51.h, left: 24.h).onPress((){
Navigator.pop(context); Navigator.pop(context);
}) })
], ],
@ -67,13 +66,12 @@ class CallAmbulancePage extends StatelessWidget {
); );
} }
Widget FixedBottomSheet(BuildContext context) { Widget fixedBottomSheet(BuildContext context) {
return GestureDetector( return GestureDetector(
onVerticalDragUpdate: (details){ onVerticalDragUpdate: (details) {
print("the delta is ${details.delta.dy}"); print("the delta is ${details.delta.dy}");
if(details.delta.dy<0){ if (details.delta.dy < 0) {
context.read<EmergencyServicesViewModel>().updateBottomSheetState(BottomSheetType.EXPANDED); context.read<EmergencyServicesViewModel>().updateBottomSheetState(BottomSheetType.EXPANDED);
} }
}, },
@ -84,15 +82,11 @@ class CallAmbulancePage extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: EdgeInsetsDirectional.only(end: 24.h, bottom: 24.h),
padding: EdgeInsetsDirectional.only(end:24.h, bottom: 24.h),
child: DecoratedBox( child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
color: AppColors.whiteColor, borderRadius: 12.h), child: Utils.buildSvgWithAssets(icon: AppAssets.locate_me, width: 24.h, height: 24.h).paddingAll(12.h),
child: Utils.buildSvgWithAssets(
icon: AppAssets.locate_me, width: 24.h, height: 24.h)
.paddingAll(12.h),
), ),
), ),
], ],
@ -110,15 +104,15 @@ class CallAmbulancePage extends StatelessWidget {
// ), // ),
// ), // ),
// ), // ),
// .paddingOnly(right: 24.h, bottom: 24.h), // .paddingOnly(right: 24.h, bottom: 24.h),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 24.h, spacing: 24.h,
children: [ children: [
TextInputWidget( TextInputWidget(
labelText: "Enter Pickup Location Manually".needTranslation, labelText: widget.isFromRRT! ? "Type Address".needTranslation : "Enter Pickup Location Manually".needTranslation,
hintText: "Enter Pickup Location".needTranslation, hintText: widget.isFromRRT! ? "Enter street or area name".needTranslation : "Enter Pickup Location".needTranslation,
leadingIcon: AppAssets.location_pickup, leadingIcon: AppAssets.location_pickup,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isEnable: false, isEnable: false,
@ -126,50 +120,27 @@ class CallAmbulancePage extends StatelessWidget {
autoFocus: false, autoFocus: false,
isBorderAllowed: false, isBorderAllowed: false,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
padding: EdgeInsets.symmetric( controller: addressController,
vertical: ResponsiveExtension(10).h, padding: EdgeInsets.symmetric(vertical: ResponsiveExtension(8).h, horizontal: ResponsiveExtension(12).h),
horizontal: ResponsiveExtension(15).h, ).paddingOnly(right: 24.h, left: 24.h),
),
).onPress(() {
context
.read<EmergencyServicesViewModel>()
.updateBottomSheetState(BottomSheetType.EXPANDED);
}).paddingOnly(right: 24.h, left: 24.h),
SizedBox( SizedBox(
height: 200.h, height: 200.h,
child: DecoratedBox( child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.scaffoldBgColor, color: AppColors.scaffoldBgColor,
customBorder: BorderRadius.only( customBorder: BorderRadius.only(topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h)),
topLeft: Radius.circular(24.h),
topRight: Radius.circular(24.h),
),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 24.h, spacing: 4,
children: [ children: [
Column( "Select Pickup Location".needTranslation.toText21(weight: FontWeight.w600, color: AppColors.textColor),
spacing: 4.h, " Please select the location of pickup".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
children: [ SizedBox(height: 20.h),
"Select Pickup Location".needTranslation.toText21(
weight: FontWeight.w600,
color: AppColors.textColor,
),
" Please select the location of pickup"
.needTranslation
.toText12(
fontWeight: FontWeight.w500,
color: AppColors.greyTextColor,
)
],
),
CustomButton( CustomButton(
text: "Select Location".needTranslation, text: "Select Location".needTranslation,
onPressed: () { onPressed: () {
context context.read<EmergencyServicesViewModel>().updateBottomSheetState(BottomSheetType.EXPANDED);
.read<EmergencyServicesViewModel>()
.updateBottomSheetState(BottomSheetType.EXPANDED);
}) })
], ],
).paddingOnly(top: 24.h, bottom: 32.h, left: 24.h, right: 24.h), ).paddingOnly(top: 24.h, bottom: 32.h, left: 24.h, right: 24.h),
@ -182,23 +153,20 @@ class CallAmbulancePage extends StatelessWidget {
); );
} }
Widget ExpanedBottomSheet(BuildContext context) { Widget expandedBottomSheet(BuildContext context) {
return GestureDetector( return GestureDetector(
onVerticalDragUpdate: (details){ onVerticalDragUpdate: (details) {
if(details.delta.dy>0){ if (details.delta.dy > 0) {
context.read<EmergencyServicesViewModel>().updateBottomSheetState(BottomSheetType.FIXED); context.read<EmergencyServicesViewModel>().updateBottomSheetState(BottomSheetType.FIXED);
} }
}, },
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
DecoratedBox( DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.scaffoldBgColor, color: AppColors.scaffoldBgColor,
customBorder: BorderRadius.only( customBorder: BorderRadius.only(topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h)),
topLeft: Radius.circular(24.h),
topRight: Radius.circular(24.h),
),
), ),
child: Column( child: Column(
children: [ children: [
@ -207,17 +175,12 @@ class CallAmbulancePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16.h, spacing: 16.h,
children: [ children: [
"Select Pickup Location".needTranslation.toText21( "Select Pickup Location".needTranslation.toText21(weight: FontWeight.w600, color: AppColors.textColor),
weight: FontWeight.w600,
color: AppColors.textColor,
),
locationsSections(context), locationsSections(context),
hospitalAndPickUpSection(context), widget.isFromRRT! ? SizedBox() : hospitalAndPickUpSection(context),
], ],
).paddingOnly(top: 24.h, bottom: 32.h,left: 24.h, right: 24.h), ).paddingOnly(top: 24.h, bottom: 32.h, left: 24.h, right: 24.h),
), ),
bottomPriceContent(context) bottomPriceContent(context)
], ],
), ),
@ -249,8 +212,7 @@ class CallAmbulancePage extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
itemCount: 3, itemCount: 3,
itemBuilder: (__, index) { itemBuilder: (__, index) {
if (index == if (index == 2) // todo means the end of the list so handle as per the viewmodel
2) // todo means the end of the list so handle as per the viewmodel
{ {
return CustomButton( return CustomButton(
height: 40.h, height: 40.h,
@ -264,11 +226,8 @@ class CallAmbulancePage extends StatelessWidget {
} else { } else {
return AddressItem( return AddressItem(
isSelected: index == 0, isSelected: index == 0,
address: address: "Flat No 301, Building No 12, Palm Spring Apartment, Sector 45, Gurugram, Haryana 122003",
"Flat No 301, Building No 12, Palm Spring Apartment, Sector 45, Gurugram, Haryana 122003", title: index == 0 ? "Home".needTranslation : "Work".needTranslation,
title: index == 0
? "Home".needTranslation
: "Work".needTranslation,
onTap: () {}, onTap: () {},
); );
} }
@ -293,11 +252,9 @@ class CallAmbulancePage extends StatelessWidget {
subTitle: "hospital".needTranslation, subTitle: "hospital".needTranslation,
leadingIcon: AppAssets.hospital, leadingIcon: AppAssets.hospital,
), ),
Utils.buildSvgWithAssets(icon: AppAssets.down_cheveron, Utils.buildSvgWithAssets(icon: AppAssets.down_cheveron, width: 24.h, height: 24.h).paddingAll(16.h)
width: 24.h, height: 24.h)
.paddingAll(16.h)
], ],
).onPress((){ ).onPress(() {
showHospitalBottomSheet(context); showHospitalBottomSheet(context);
}), }),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -307,7 +264,6 @@ class CallAmbulancePage extends StatelessWidget {
thickness: 1, thickness: 1,
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
children: [ children: [
hospitalAndPickUpItemContent( hospitalAndPickUpItemContent(
@ -317,8 +273,8 @@ class CallAmbulancePage extends StatelessWidget {
), ),
CustomSwitch( CustomSwitch(
value: context.watch<EmergencyServicesViewModel>().isGMSAvailable, value: context.watch<EmergencyServicesViewModel>().isGMSAvailable,
onChanged: (value){ onChanged: (value) {
context.read<EmergencyServicesViewModel>().setIsGMSAvailable( value); context.read<EmergencyServicesViewModel>().setIsGMSAvailable(value);
}, },
) )
], ],
@ -378,68 +334,49 @@ class CallAmbulancePage extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
DecoratedBox( DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder()
color: AppColors.scaffoldBgColor, .toSmoothCornerDecoration(color: AppColors.scaffoldBgColor, customBorder: BorderRadius.only(topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h)), hasShadow: true),
customBorder: BorderRadius.only( child: Column(
topLeft: Radius.circular(24.h), crossAxisAlignment: CrossAxisAlignment.start,
topRight: Radius.circular(24.h), spacing: 12.h,
), children: [
hasShadow: true Row(
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 12.h,
children: [ children: [
Row( Expanded(
children: [ child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
child: Column( spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.start, children: [
spacing: 4.h, "Total amount to pay".needTranslation.toText18(weight: FontWeight.w600, color: AppColors.textColor),
Row(
children: [ children: [
"Total amount to pay".needTranslation.toText18( Utils.buildSvgWithAssets(icon: AppAssets.warning, height: 18.h, width: 18.h),
weight: FontWeight.w600, SizedBox(width: 4.h),
color: AppColors.textColor, "Amount will be paid at the hospital".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
),
Row(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.warning,
height: 18.h, width: 18.h),
SizedBox(width: 4.h,),
"Amount will be paid at the hospital"
.needTranslation
.toText12(
fontWeight: FontWeight.w500,
color: AppColors.greyTextColor,
),
],
)
], ],
), )
), ],
"\$250".toText24( ),
fontWeight: FontWeight.w600,
color: AppColors.textColor,
)
],
), ),
CustomButton( Utils.getPaymentAmountWithSymbol("250".toString().toText24(isBold: true), AppColors.blackColor, 17, isSaudiCurrency: true),
text: "Submit Request".needTranslation,
onPressed: () {
Navigator.push(context, CustomPageRoute(page: RequestingServicesPage()));
})
], ],
).paddingOnly(top: 24.h, bottom: 12.h, left: 24.h, right: 24.h), ),
), CustomButton(
text: "Submit Request".needTranslation,
onPressed: () {
Navigator.push(context, CustomPageRoute(page: RequestingServicesPage()));
})
],
).paddingOnly(top: 24.h, bottom: 24.h, left: 24.h, right: 24.h),
),
], ],
); );
} }
showHospitalBottomSheet(BuildContext context){ showHospitalBottomSheet(BuildContext context) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: title: LocaleKeys.selectHospital.tr(),
LocaleKeys.selectHospital.tr(),
context, context,
child: HospitalBottomSheetBody(), child: HospitalBottomSheetBody(),
isFullScreen: false, isFullScreen: false,

@ -7,11 +7,12 @@ 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/presentation/emergency_services/call_ambulance/tracking_screen.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/tracking_screen.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/routes/custom_page_route.dart' import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart' show CustomPageRoute;
show CustomPageRoute;
import 'package:lottie/lottie.dart'; import 'package:lottie/lottie.dart';
class RequestingServicesPage extends StatefulWidget { class RequestingServicesPage extends StatefulWidget {
RequestingServicesPage({super.key});
@override @override
State<RequestingServicesPage> createState() => _RequestingServicesPageState(); State<RequestingServicesPage> createState() => _RequestingServicesPageState();
} }
@ -20,8 +21,7 @@ class _RequestingServicesPageState extends State<RequestingServicesPage> {
@override @override
void initState() { void initState() {
Timer(Duration(seconds: 3), () { Timer(Duration(seconds: 3), () {
Navigator.pushReplacement( Navigator.pushReplacement(context, CustomPageRoute(page: TrackingScreen()));
context, CustomPageRoute(page: TrackingScreen()));
}); });
super.initState(); super.initState();
} }
@ -32,14 +32,7 @@ class _RequestingServicesPageState extends State<RequestingServicesPage> {
color: AppColors.scaffoldBgColor, color: AppColors.scaffoldBgColor,
child: Stack( child: Stack(
children: [ children: [
Lottie.asset(AppAnimations.loadingAnimation, Lottie.asset(AppAnimations.loadingAnimation, width: 80.h, height: 80.h, repeat: true, reverse: false, frameRate: FrameRate(60), fit: BoxFit.fill).center,
width: 80.h,
height: 80.h,
repeat: true,
reverse: false,
frameRate: FrameRate(60),
fit: BoxFit.fill)
.center,
Positioned( Positioned(
bottom: 1, bottom: 1,
child: "Submitting your request. \nPlease wait for a moment" child: "Submitting your request. \nPlease wait for a moment"

@ -20,38 +20,37 @@ import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class TrackingScreen extends StatelessWidget { class TrackingScreen extends StatelessWidget {
final OrderTrackingState state = OrderTrackingState.ended; final OrderTrackingState state = OrderTrackingState.waitingForCall;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return CollapsingListView(
bottomNavigationBar: Visibility( title: "Tracking Details".needTranslation,
visible: state == OrderTrackingState.ended, bottomChild: Visibility(
child: SafeArea( visible: state == OrderTrackingState.ended,
child: CustomButton( child: CustomButton(
height: 56.h, height: 50.h,
backgroundColor: AppColors.bgGreenColor, backgroundColor: AppColors.bgGreenColor,
borderColor: Colors.transparent, borderColor: Colors.transparent,
text: "Close".needTranslation, text: "Close".needTranslation,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
onPressed: () {}, onPressed: () {},
).paddingOnly(left:16.h,right:16.h), ).paddingOnly(left: 16.h, right: 16.h, bottom: 16.h),
),
), ),
body: CollapsingListView( child: SingleChildScrollView(
title: "Tracking Details".needTranslation, child: Column(
child: SingleChildScrollView( children: [
child: Column( animationSection(),
children: [ Column(
animationSection(), spacing: 16.h,
Column( children: [OrderStatus(context), OrderTrackingId(), ContactSection()],
spacing: 16.h, ).paddingAll(16.h),
children: [OrderStatus(context), OrderTrackingId(), ContactSection()], ],
).paddingAll(16.h), )),
],
))),
); );
} }
animationSection(){
animationSection() {
switch (state) { switch (state) {
case OrderTrackingState.waitingForCall: case OrderTrackingState.waitingForCall:
case OrderTrackingState.dispactched: case OrderTrackingState.dispactched:
@ -59,18 +58,14 @@ class TrackingScreen extends StatelessWidget {
return Lottie.asset(AppAnimations.ambulance, repeat: true, reverse: false, width: 260.h, height: 200.h); return Lottie.asset(AppAnimations.ambulance, repeat: true, reverse: false, width: 260.h, height: 200.h);
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
return Lottie.asset(AppAnimations.checkmark, repeat: true, width: 260.h, height: 200.h); return Lottie.asset(AppAnimations.checkmark, repeat: true, width: 260.h, height: 200.h);
} }
} }
OrderStatus(BuildContext context) { OrderStatus(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: false),
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -95,7 +90,7 @@ class TrackingScreen extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 16,), SizedBox(height: 16.h),
CustomButton( CustomButton(
text: "Cancel Request".needTranslation, text: "Cancel Request".needTranslation,
onPressed: () async {}, onPressed: () async {},
@ -119,7 +114,7 @@ class TrackingScreen extends StatelessWidget {
backgroundColor: AppColors.lightRedButtonColor, backgroundColor: AppColors.lightRedButtonColor,
borderColor: Colors.transparent, borderColor: Colors.transparent,
text: "Share Your Live Locatin on Whatsapp".needTranslation, text: "Share Your Live Locatin on Whatsapp".needTranslation,
fontSize: 12.fSize, fontSize: 12.f,
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
onPressed: () {}, onPressed: () {},
@ -131,11 +126,7 @@ class TrackingScreen extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 12.h, spacing: 12.h,
children: [ children: [dividerSection, doctorSection(), mapSection(context)],
dividerSection,
doctorSection(),
mapSection(context)
],
); );
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
@ -170,17 +161,14 @@ class TrackingScreen extends StatelessWidget {
return Row( return Row(
spacing: 16.h, spacing: 16.h,
children: [ children: [
Utils.buildImgWithNetwork(url: "", iconColor: Colors.transparent) Utils.buildImgWithNetwork(url: "", iconColor: Colors.transparent).circle(52.h),
.circle(52.h),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Dr. John Doe".toText16( "Dr. John Doe".toText16(color: AppColors.textColor, weight: FontWeight.w600),
color: AppColors.textColor, weight: FontWeight.w600),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"MBBS, MD - General Medicine".toText12( "MBBS, MD - General Medicine".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -204,96 +192,83 @@ class TrackingScreen extends StatelessWidget {
Widget mapForRequestedCoordinate(BuildContext context) { Widget mapForRequestedCoordinate(BuildContext context) {
// return SizedBox.shrink(); // return SizedBox.shrink();
if (context.read<EmergencyServicesViewModel>().isGMSAvailable || if (context.read<EmergencyServicesViewModel>().isGMSAvailable || Platform.isIOS) {
Platform.isIOS) return GMSMap(
return GMSMap( myLocationEnabled: false,
myLocationEnabled: false, currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(),
currentLocation: onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value));
context.read<EmergencyServicesViewModel>().getGMSLocation(), } else {
onCameraMoved: (value) => context
.read<EmergencyServicesViewModel>()
.handleGMSMapCameraMoved(value));
else
return HMSMap( return HMSMap(
myLocationEnabled: false, myLocationEnabled: false,
currentLocation: currentLocation: context.read<EmergencyServicesViewModel>().getHMSLocation(),
context.read<EmergencyServicesViewModel>().getHMSLocation(), onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleHMSMapCameraMoved(value));
onCameraMoved: (value) => context }
.read<EmergencyServicesViewModel>()
.handleHMSMapCameraMoved(value));
} }
informationRegardingTrackingSection() { informationRegardingTrackingSection() {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [currentStatus(), SizedBox(height: 4.h), "You will receive a call from HMG for confirmation ".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500)],
currentStatus(),
SizedBox(height: 4.h),
"You will receive a call from HMG for confirmation ".toText12(
color: AppColors.greyTextColor, fontWeight: FontWeight.w500)
],
); );
} }
currentStatus() { currentStatus() {
switch (state) { switch (state) {
case OrderTrackingState.waitingForCall: case OrderTrackingState.waitingForCall:
case OrderTrackingState.dispactched: case OrderTrackingState.dispactched:
return RichText( return RichText(
text: TextSpan(children: <TextSpan>[ text: TextSpan(children: <TextSpan>[
TextSpan( TextSpan(
text: "Please wait for the call".needTranslation, text: "Please wait for the call".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
), ),
TextSpan( TextSpan(
text: "...".needTranslation, text: "...".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.errorColor, color: AppColors.errorColor,
), ),
), ),
]), ]),
); );
case OrderTrackingState.returning: case OrderTrackingState.returning:
return RichText( return RichText(
text: TextSpan(children: <TextSpan>[ text: TextSpan(children: <TextSpan>[
TextSpan( TextSpan(
text: "15:30".needTranslation, text: "15:30".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
), ),
TextSpan( TextSpan(
text: " mins ".needTranslation, text: " mins ".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.errorColor, color: AppColors.errorColor,
), ),
), ),
TextSpan( TextSpan(
text: "to hospital".needTranslation, text: "to hospital".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 21.fSize, fontSize: 21.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
), ),
), ),
]), ]),
); );
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
return "Arrived" return "Arrived".needTranslation.toText21(color: AppColors.textColor, weight: FontWeight.w600);
.needTranslation }
.toText21(color: AppColors.textColor, weight: FontWeight.w600);
}
} }
OrderTrackingId() { OrderTrackingId() {
@ -308,19 +283,15 @@ class TrackingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8.h, spacing: 8.h,
children: [ children: [
"Req ID:1234567890" "Req ID:1234567890".toText16(color: AppColors.textColor, weight: FontWeight.w600),
.toText16(color: AppColors.textColor, weight: FontWeight.w600),
Row( Row(
spacing: 8.h, spacing: 8.h,
children: [ children: [
Chip("location name".needTranslation, AppAssets.location_pickup, Chip("location name".needTranslation, AppAssets.location_pickup, AppColors.blackBgColor),
AppColors.blackBgColor), Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
Chip("hotel name ".needTranslation, AppAssets.hospital,
AppColors.blackBgColor),
], ],
), ),
Chip("hotel name ".needTranslation, AppAssets.hospital, Chip("hotel name ".needTranslation, AppAssets.hospital, AppColors.blackBgColor),
AppColors.blackBgColor),
], ],
), ),
); );
@ -350,11 +321,8 @@ class TrackingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h, spacing: 4.h,
children: [ children: [
"Contact Rapid Response Team (RRT)".needTranslation.toText14( "Contact Rapid Response Team (RRT)".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w600),
color: AppColors.textColor, weight: FontWeight.w600), "1223456789".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500),
"1223456789".needTranslation.toText12(
color: AppColors.primaryRedColor,
fontWeight: FontWeight.w500),
SizedBox(height: 8.h), SizedBox(height: 8.h),
], ],
), ),
@ -390,27 +358,22 @@ class TrackingScreen extends StatelessWidget {
getTitle(OrderTrackingState state) { getTitle(OrderTrackingState state) {
switch (state) { switch (state) {
case OrderTrackingState.waitingForCall: case OrderTrackingState.waitingForCall:
return "Confirmation Call".needTranslation return "Confirmation Call".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.dispactched: case OrderTrackingState.dispactched:
return "Pickup Up from Home".needTranslation return "Pickup Up from Home".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.returning: case OrderTrackingState.returning:
return " On The Way To Hospital".needTranslation return " On The Way To Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
case OrderTrackingState.ended: case OrderTrackingState.ended:
default: default:
return "Arrived at Hospital".needTranslation return "Arrived at Hospital".needTranslation.toText16(color: AppColors.textColor, weight: FontWeight.w600);
.toText16(color: AppColors.textColor, weight: FontWeight.w600);
} }
} }
mapSection(BuildContext context) { mapSection(BuildContext context) {
return SizedBox( return SizedBox(
height: 170.h, height: 170.h,
width: double.infinity, width: double.infinity,
child: ClipRRect( child: ClipRRect(borderRadius: BorderRadius.circular(20.h), child: mapForRequestedCoordinate(context)),
borderRadius: BorderRadius.circular(20.h),child: mapForRequestedCoordinate(context)),
); );
} }
} }

@ -67,8 +67,7 @@ class EmergencyServicesPage extends StatelessWidget {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Container( child: Container(
decoration: decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
borderRadius: 24.h, borderRadius: 24.h,
), ),
@ -92,22 +91,11 @@ class EmergencyServicesPage extends StatelessWidget {
}), }),
], ],
), ),
Lottie.asset(AppAnimations.ambulance_alert, Lottie.asset(AppAnimations.ambulance_alert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain),
repeat: false,
reverse: false,
frameRate: FrameRate(60),
width: 120.h,
height: 120.h,
fit: BoxFit.contain),
SizedBox(height: 8.h), SizedBox(height: 8.h),
"Confirmation".needTranslation.toText28( "Confirmation".needTranslation.toText28(color: AppColors.whiteColor, isBold: true),
color: AppColors.whiteColor, isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
"Are you sure you want to call an ambulance?" "Are you sure you want to call an ambulance?".needTranslation.toText14(color: AppColors.whiteColor, weight: FontWeight.w500),
.needTranslation
.toText14(
color: AppColors.whiteColor,
weight: FontWeight.w500),
SizedBox(height: 24.h), SizedBox(height: 24.h),
CustomButton( CustomButton(
text: LocaleKeys.confirm.tr(context: context), text: LocaleKeys.confirm.tr(context: context),
@ -115,15 +103,11 @@ class EmergencyServicesPage extends StatelessWidget {
// //
Navigator.of(context).pop(); Navigator.of(context).pop();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
title: title: "Transport Options".needTranslation,
"Transport Options".needTranslation,
context, context,
child: AmbulanceOptionSelectionBottomSheet( child: AmbulanceOptionSelectionBottomSheet(onTap: () {
onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
context context.read<EmergencyServicesViewModel>().navigateTOAmbulancePage();
.read<EmergencyServicesViewModel>()
.navigateTOAmbulancePage();
}), }),
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,
@ -182,11 +166,7 @@ class EmergencyServicesPage extends StatelessWidget {
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: false),
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
),
child: Row( child: Row(
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h), Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h),
@ -195,8 +175,8 @@ class EmergencyServicesPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Rapid Response Team (RRT)".toText16(isBold: true, color: AppColors.blackColor), "Rapid Response Team (RRT)".needTranslation.toText16(isBold: true, color: AppColors.blackColor),
"Comprehensive medical service for all sorts of urgent and stable cases".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), "Comprehensive medical service for all sorts of urgent and stable cases".needTranslation.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -204,71 +184,57 @@ class EmergencyServicesPage extends StatelessWidget {
Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h),
], ],
).onPress(() { ).onPress(() {
showCommonBottomSheetWithoutHeight( locationUtils!.getLocation(
context, isShowConfirmDialog: true,
child: Container( onSuccess: (position) {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( showCommonBottomSheetWithoutHeight(
color: AppColors.primaryRedColor, context,
borderRadius: 24.h, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: Padding( children: [
padding: EdgeInsets.all(24.h), Lottie.asset(AppAnimations.ambulance_alert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.contain),
child: Column( SizedBox(height: 8.h),
crossAxisAlignment: CrossAxisAlignment.start, "Confirmation".needTranslation.toText28(
children: [ color: AppColors.whiteColor,
Row( isBold: true,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ SizedBox(height: 8.h),
"".toText14(), "Are you sure you want to call Rapid Response Team (RRT)?".needTranslation.toText16(color: AppColors.whiteColor, weight: FontWeight.w500),
Utils.buildSvgWithAssets( SizedBox(height: 24.h),
icon: AppAssets.cancel_circle_icon, CustomButton(
iconColor: AppColors.whiteColor, text: LocaleKeys.confirm.tr(context: context),
width: 24.h, onPressed: () async {
height: 24.h,
fit: BoxFit.contain,
).onPress(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
}), showCommonBottomSheetWithoutHeight(
], title: "Rapid Response Team (RRT)".needTranslation,
), context,
Lottie.asset(AppAnimations.ambulance_alert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), child: RrtRequestTypeSelect(),
SizedBox(height: 8.h), isFullScreen: false,
"Confirmation".needTranslation.toText28(color: AppColors.whiteColor, isBold: true), isCloseButtonVisible: true,
SizedBox(height: 8.h), hasBottomPadding: false,
"Are you sure you want to call Rapid Response Team (RRT)?".needTranslation.toText14(color: AppColors.whiteColor, weight: FontWeight.w500), isDisablePadding: true,
SizedBox(height: 24.h), backgroundColor: AppColors.bottomSheetBgColor,
CustomButton( callBackFunc: () {},
text: LocaleKeys.confirm.tr(context: context), );
onPressed: () async { },
Navigator.of(context).pop(); backgroundColor: AppColors.whiteColor,
showCommonBottomSheetWithoutHeight( borderColor: AppColors.whiteColor,
title: "Rapid Response Team (RRT)".needTranslation, textColor: AppColors.primaryRedColor,
context, icon: AppAssets.checkmark_icon,
child: RrtRequestTypeSelect(), iconColor: AppColors.primaryRedColor,
isFullScreen: false, ),
isCloseButtonVisible: true, SizedBox(height: 20.h),
hasBottomPadding: false, ],
backgroundColor: AppColors.bottomSheetBgColor, ),
callBackFunc: () {}, isFullScreen: false,
); isCloseButtonVisible: true,
}, hasBottomPadding: false,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.whiteColor, iconColor: Colors.white,
textColor: AppColors.primaryRedColor, customCloseIcon: AppAssets.cancel_circle_icon,
icon: AppAssets.checkmark_icon, callBackFunc: () {},
iconColor: AppColors.primaryRedColor, );
), });
SizedBox(height: 8.h),
],
),
),
),
isFullScreen: false,
isCloseButtonVisible: false,
hasBottomPadding: false,
backgroundColor: AppColors.primaryRedColor,
callBackFunc: () {},
);
}), }),
), ),
], ],

@ -51,7 +51,6 @@ class _FamilyMedicalScreenState extends State<FamilyMedicalScreen> {
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
@ -69,6 +68,7 @@ class _FamilyMedicalScreenState extends State<FamilyMedicalScreen> {
text: "Add a new family member".needTranslation, text: "Add a new family member".needTranslation,
onPressed: () { onPressed: () {
DialogService dialogService = getIt.get<DialogService>(); DialogService dialogService = getIt.get<DialogService>();
medicalVM!.clearAuthValues();
dialogService.showAddFamilyFileSheet( dialogService.showAddFamilyFileSheet(
label: "Add Family Member".needTranslation, label: "Add Family Member".needTranslation,
message: "Please fill the below field to add a new family member to your profile".needTranslation, message: "Please fill the below field to add a new family member to your profile".needTranslation,

@ -54,6 +54,7 @@ class CollapsingListView extends StatelessWidget {
SliverAppBar( SliverAppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
pinned: true, pinned: true,
expandedHeight: 100.h, expandedHeight: 100.h,
stretch: true, stretch: true,
systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light), systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light),

@ -105,17 +105,20 @@ class ButtonSheetContent extends StatelessWidget {
} }
void showCommonBottomSheetWithoutHeight( void showCommonBottomSheetWithoutHeight(
BuildContext context, { BuildContext context, {
required Widget child, required Widget child,
required VoidCallback callBackFunc, required VoidCallback callBackFunc,
String title = "", String title = "",
bool isCloseButtonVisible = true, bool isCloseButtonVisible = true,
bool isFullScreen = true, bool isFullScreen = true,
bool isDismissible = true, bool isDismissible = true,
Widget? titleWidget, Widget? titleWidget,
bool useSafeArea = false, bool useSafeArea = false,
bool hasBottomPadding = true, bool hasBottomPadding = true,
Color backgroundColor = AppColors.bottomSheetBgColor, Color backgroundColor = AppColors.bottomSheetBgColor,
Color iconColor = const Color(0xff2B353E),
String? customCloseIcon,
bool isDisablePadding = false,
}) { }) {
showModalBottomSheet<String>( showModalBottomSheet<String>(
sheetAnimationStyle: AnimationStyle( sheetAnimationStyle: AnimationStyle(
@ -145,40 +148,32 @@ void showCommonBottomSheetWithoutHeight(
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
child: isCloseButtonVisible child: isCloseButtonVisible
? Container( ? Container(
padding: EdgeInsets.only( padding: isDisablePadding ? null : EdgeInsets.only(left: 24, top: 24, right: 24, bottom: 12),
left: 24, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: backgroundColor, borderRadius: 24.h),
top: 24, child: Column(
right: 24, mainAxisSize: MainAxisSize.min,
bottom: 12, children: [
), Row(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: AppColors.bottomSheetBgColor, crossAxisAlignment: CrossAxisAlignment.center,
borderRadius: 24.h, children: [
), titleWidget ??
child: Column( Expanded(
mainAxisSize: MainAxisSize.min, child: title.toText20(weight: FontWeight.w600),
children: [ ),
Row( Utils.buildSvgWithAssets(
mainAxisAlignment: MainAxisAlignment.spaceBetween, icon: customCloseIcon ?? AppAssets.close_bottom_sheet_icon,
crossAxisAlignment: CrossAxisAlignment.center, iconColor: iconColor,
children: [ ).onPress(() {
titleWidget ?? Navigator.of(context).pop();
Expanded( }),
child: title.toText20(weight: FontWeight.w600), ],
), ).paddingOnly(left: isDisablePadding ? 24 : 0, right: isDisablePadding ? 24 : 0, bottom: isDisablePadding ? 12 : 0, top: isDisablePadding ? 24 : 0),
Utils.buildSvgWithAssets( SizedBox(height: 16.h),
icon: AppAssets.close_bottom_sheet_icon, child,
iconColor: Color(0xff2B353E), ],
).onPress(() { ),
Navigator.of(context).pop(); )
}),
],
),
SizedBox(height: 16.h),
child,
],
),
)
: child, : child,
), ),
), ),

@ -10,7 +10,7 @@ class ExpandableBottomSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print("the currently selected item is ${bottomSheetType}"); print("the currently selected item is $bottomSheetType");
return AnimatedCrossFade( return AnimatedCrossFade(
duration: const Duration(milliseconds: 600), duration: const Duration(milliseconds: 600),
firstChild:children[BottomSheetType.FIXED] ?? SizedBox.shrink(), firstChild:children[BottomSheetType.FIXED] ?? SizedBox.shrink(),

@ -11,14 +11,13 @@ class CustomRadioOption<T> extends StatelessWidget {
// final Widget child; // The content of your radio option (e.g., Text, Image) // final Widget child; // The content of your radio option (e.g., Text, Image)
const CustomRadioOption({ const CustomRadioOption(
super.key, {super.key,
required this.value, required this.value,
required this.groupValue, required this.groupValue,
required this.onChanged, required this.onChanged,
// required this.child, // required this.child,
required this.text, required this.text});
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -31,13 +30,12 @@ class CustomRadioOption<T> extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 20.h, width: 18.h,
height: 20.h, height: 18.h,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor, color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor,
border: Border.all(color: isSelected ? AppColors.primaryRedColor : AppColors.bottomNAVBorder, width: 2.h), border: Border.all(color: isSelected ? AppColors.primaryRedColor : AppColors.bottomNAVBorder, width: 2.h)),
),
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
text.toText16(weight: FontWeight.w500), // The provided content text.toText16(weight: FontWeight.w500), // The provided content

Loading…
Cancel
Save