haroon_dev #53

Merged
Haroon6138 merged 3 commits from haroon_dev into master 1 month ago

@ -176,8 +176,8 @@ class ApiClientImp implements ApiClient {
body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken; body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken;
} }
body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
body['PatientID'] = 3628599; // body['PatientID'] = 3628599;
} }
body.removeWhere((key, value) => value == null); body.removeWhere((key, value) => value == null);

@ -723,7 +723,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In
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

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_repo.dart'; import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_repo.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
class HabibWalletViewModel extends ChangeNotifier { class HabibWalletViewModel extends ChangeNotifier {
@ -8,6 +10,10 @@ class HabibWalletViewModel extends ChangeNotifier {
num habibWalletAmount = 0; num habibWalletAmount = 0;
num walletRechargeAmount = 0; num walletRechargeAmount = 0;
bool isBottomSheetContentLoading = false;
bool isSearchedFileNumberDataShown = false;
int currentIndex = 0; int currentIndex = 0;
List<HospitalsModel> advancePaymentHospitals = []; List<HospitalsModel> advancePaymentHospitals = [];
@ -21,12 +27,16 @@ class HabibWalletViewModel extends ChangeNotifier {
String depositorName = ''; String depositorName = '';
String mobileNumber = ''; String mobileNumber = '';
num selectedRechargeType = 1;
HabibWalletViewModel({required this.habibWalletRepo, required this.errorHandlerService}); HabibWalletViewModel({required this.habibWalletRepo, required this.errorHandlerService});
initHabibWalletProvider() { initHabibWalletProvider() {
isWalletAmountLoading = true; isWalletAmountLoading = true;
isBottomSheetContentLoading = false;
habibWalletAmount = 0; habibWalletAmount = 0;
walletRechargeAmount = 0; walletRechargeAmount = 0;
selectedRechargeType = 1;
advancePaymentHospitals.clear(); advancePaymentHospitals.clear();
selectedHospital = null; selectedHospital = null;
fileNumber = ''; fileNumber = '';
@ -35,6 +45,11 @@ class HabibWalletViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
setSelectedRechargeType(num type) {
selectedRechargeType = type;
notifyListeners();
}
setSelectedHospital(HospitalsModel hospital) { setSelectedHospital(HospitalsModel hospital) {
selectedHospital = hospital; selectedHospital = hospital;
notifyListeners(); notifyListeners();
@ -57,6 +72,19 @@ class HabibWalletViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
String getSelectedRechargeTypeValue() {
switch (selectedRechargeType) {
case 1:
return LocaleKeys.myAccount.tr();
case 2:
return LocaleKeys.family.tr();
case 3:
return LocaleKeys.otherAccount.tr();
default:
return LocaleKeys.myAccount.tr();
}
}
Future<void> getPatientBalanceAmount({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientBalanceAmount({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isWalletAmountLoading = true; isWalletAmountLoading = true;
notifyListeners(); notifyListeners();
@ -144,14 +172,21 @@ class HabibWalletViewModel extends ChangeNotifier {
} }
Future<void> getPatientInfoByPatientID({required String patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientInfoByPatientID({required String patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
isBottomSheetContentLoading = true;
notifyListeners();
final result = await habibWalletRepo.getPatientInfoByPatientID(patientID: patientID); final result = await habibWalletRepo.getPatientInfoByPatientID(patientID: patientID);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async {
isBottomSheetContentLoading = false;
notifyListeners();
await errorHandlerService.handleError(failure: failure);
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) { } else if (apiResponse.messageStatus == 1) {
isBottomSheetContentLoading = false;
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(apiResponse); onSuccess(apiResponse);

@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.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/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';
@ -34,6 +35,7 @@ import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../core/dependencies.dart';
import '../medical_file/widgets/medical_file_card.dart'; import '../medical_file/widgets/medical_file_card.dart';
class AppointmentDetailsPage extends StatefulWidget { class AppointmentDetailsPage extends StatefulWidget {
@ -63,6 +65,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false); myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false); prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false);
bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false); bookAppointmentsViewModel = Provider.of<BookAppointmentsViewModel>(context, listen: false);
@ -313,12 +316,15 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
], ],
), ),
SizedBox(width: 68.h), SizedBox(width: 68.h),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
height: 13.h,
fit: BoxFit.contain,
),
), ),
], ],
), ),

@ -103,13 +103,16 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
const Spacer(), const Spacer(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading),
),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
@ -142,13 +145,16 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
const Spacer(), const Spacer(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading),
),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
@ -175,13 +181,16 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
const Spacer(), const Spacer(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading),
),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {

@ -2,6 +2,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.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';
@ -21,6 +23,7 @@ class MyDoctorsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false); myAppointmentsViewModel = Provider.of<MyAppointmentsViewModel>(context, listen: false);
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
@ -136,7 +139,9 @@ class MyDoctorsPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"".toText16(), "".toText16(),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor), Transform.flip(
flipX: appState.isArabic() ? true : false,
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)),
], ],
), ),
], ],

@ -151,8 +151,12 @@ class _AppointmentCardState extends State<AppointmentCard> {
spacing: 3.h, spacing: 3.h,
runSpacing: 4.h, runSpacing: 4.h,
children: [ children: [
widget.isFromHomePage ? SizedBox.shrink() : AppCustomChipWidget(labelText: widget.isLoading ? "Cardiology" : widget.patientAppointmentHistoryResponseModel.clinicName!).toShimmer2(isShow: widget.isLoading), widget.isFromHomePage
widget.isFromHomePage ? SizedBox.shrink() : AppCustomChipWidget(labelText: widget.isLoading ? "Olaya" : widget.patientAppointmentHistoryResponseModel.projectName!).toShimmer2(isShow: widget.isLoading), ? SizedBox.shrink()
: AppCustomChipWidget(labelText: widget.isLoading ? "Cardiology" : widget.patientAppointmentHistoryResponseModel.clinicName!).toShimmer2(isShow: widget.isLoading),
widget.isFromHomePage
? SizedBox.shrink()
: AppCustomChipWidget(labelText: widget.isLoading ? "Olaya" : widget.patientAppointmentHistoryResponseModel.projectName!).toShimmer2(isShow: widget.isLoading),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon, icon: AppAssets.appointment_calendar_icon,
labelText: labelText:
@ -215,11 +219,15 @@ class _AppointmentCardState extends State<AppointmentCard> {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
child: Utils.buildSvgWithAssets( child: Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
width: 10.h, child: Utils.buildSvgWithAssets(
height: 10.h, icon: AppAssets.forward_arrow_icon,
fit: BoxFit.contain, iconColor: AppColors.whiteColor,
width: 10.h,
height: 10.h,
fit: BoxFit.contain,
),
), ),
), ),
).toShimmer2(isShow: widget.isLoading).onPress(() { ).toShimmer2(isShow: widget.isLoading).onPress(() {

@ -31,11 +31,12 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
bool _supportsNFC = false; bool _supportsNFC = false;
late LocationUtils locationUtils; late LocationUtils locationUtils;
late AppState appState;
ProjectDetailListModel projectDetailListModel = ProjectDetailListModel(); ProjectDetailListModel projectDetailListModel = ProjectDetailListModel();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState _appState = getIt.get<AppState>(); appState = getIt.get<AppState>();
FlutterNfcKit.nfcAvailability.then((value) { FlutterNfcKit.nfcAvailability.then((value) {
_supportsNFC = (value == NFCAvailability.available); _supportsNFC = (value == NFCAvailability.available);
}); });
@ -53,7 +54,7 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
// appState: myAppointmentsViewModel.appState, // appState: myAppointmentsViewModel.appState,
// ); // );
locationUtils.getCurrentLocation(onSuccess: (value) { locationUtils.getCurrentLocation(onSuccess: (value) {
projectDetailListModel = Utils.getProjectDetailObj(_appState, patientAppointmentHistoryResponseModel.projectID); projectDetailListModel = Utils.getProjectDetailObj(appState, patientAppointmentHistoryResponseModel.projectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000; double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
print(dist); print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) { if (dist <= projectDetailListModel.geofenceRadius!) {
@ -120,12 +121,15 @@ class AppointmentCheckinBottomSheet extends StatelessWidget {
], ],
), ),
), ),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
height: 13.h,
fit: BoxFit.contain,
),
), ),
], ],
), ),

@ -1,5 +1,7 @@
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';
@ -21,6 +23,7 @@ class FacilitySelectionItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
@ -42,12 +45,15 @@ class FacilitySelectionItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
info, info,
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18, icon: AppAssets.forward_arrow_icon,
height: 13, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18,
height: 13,
fit: BoxFit.contain,
),
), ),
], ],
) )

@ -38,12 +38,15 @@ class HospitalListItem extends StatelessWidget {
children: [hospitalName, distanceInfo], children: [hospitalName, distanceInfo],
), ),
), ),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18, icon: AppAssets.forward_arrow_icon,
height: 13, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18,
height: 13,
fit: BoxFit.contain,
),
), ),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),

@ -1,6 +1,8 @@
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_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';
@ -15,15 +17,11 @@ class RegionListItem extends StatelessWidget {
final String hmgCount; final String hmgCount;
final String subTitle; final String subTitle;
const RegionListItem( const RegionListItem({super.key, required this.title, required this.subTitle, required this.hmcCount, required this.hmgCount});
{super.key,
required this.title,
required this.subTitle,
required this.hmcCount,
required this.hmgCount});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
@ -40,18 +38,19 @@ class RegionListItem extends StatelessWidget {
Row( Row(
spacing: 8.h, spacing: 8.h,
children: [ children: [
placesCountItem( placesCountItem(AppAssets.hmg, hmgCount, " ${LocaleKeys.hospital.tr()}"),
AppAssets.hmg, hmgCount, " ${LocaleKeys.hospital.tr()}"), placesCountItem(AppAssets.hmc, hmcCount, " ${LocaleKeys.medicalCenters.tr()}"),
placesCountItem(AppAssets.hmc, hmcCount,
" ${LocaleKeys.medicalCenters.tr()}"),
], ],
), ),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18, icon: AppAssets.forward_arrow_icon,
height: 13, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18,
height: 13,
fit: BoxFit.contain,
),
), ),
], ],
) )
@ -66,24 +65,14 @@ class RegionListItem extends StatelessWidget {
icon: svgPath, icon: svgPath,
iconHasColor: false, iconHasColor: false,
richText: RichText( richText: RichText(
text: TextSpan( text: TextSpan(
text: count, text: count,
style: TextStyle( style: TextStyle(fontSize: 12.h, fontWeight: FontWeight.w700, color: AppColors.blackColor),
fontSize: 12.h, children: [TextSpan(text: title, style: TextStyle(fontSize: 12.h, fontWeight: FontWeight.w500, color: AppColors.blackColor))])),
fontWeight: FontWeight.w700,
color: AppColors.blackColor),
children: [
TextSpan(
text: title,
style: TextStyle(
fontSize: 12.h,
fontWeight: FontWeight.w500,
color: AppColors.blackColor))
])),
); );
} }
Widget get header => Column( Widget get header => Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -117,7 +117,8 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
), ),
], ],
), ),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
], ],
).onPress(() { ).onPress(() {
bookAppointmentsViewModel.setIsClinicsListLoading(true); bookAppointmentsViewModel.setIsClinicsListLoading(true);
@ -148,7 +149,8 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
), ),
], ],
), ),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
], ],
).onPress(() { ).onPress(() {
bookAppointmentsViewModel.setIsDoctorSearchByNameStarted(false); bookAppointmentsViewModel.setIsDoctorSearchByNameStarted(false);
@ -177,7 +179,8 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
), ),
], ],
), ),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), Transform.flip(
flipX: appState.isArabic() ? true : false, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h)),
], ],
).onPress(() { ).onPress(() {
openRegionListBottomSheet(context); openRegionListBottomSheet(context);

@ -1,5 +1,7 @@
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';
@ -15,6 +17,7 @@ class ClinicCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container( return Container(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
@ -33,7 +36,9 @@ class ClinicCard extends StatelessWidget {
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Expanded(child: (isLoading ? "Cardiology" : clinicsListResponseModel.clinicDescription!).toText16(isBold: true).toShimmer2(isShow: isLoading)), Expanded(child: (isLoading ? "Cardiology" : clinicsListResponseModel.clinicDescription!).toText16(isBold: true).toShimmer2(isShow: isLoading)),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor).toShimmer2(isShow: isLoading), Transform.flip(
flipX: appState.isArabic() ? true : false,
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor).toShimmer2(isShow: isLoading)),
]), ]),
], ],
), ),

@ -102,7 +102,7 @@ class _HabibWalletState extends State<HabibWalletPage> {
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
borderRadius: 12, borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h, height: 40.h,
), ),
], ],

@ -34,11 +34,15 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
FocusNode textFocusNode = FocusNode(); FocusNode textFocusNode = FocusNode();
late HabibWalletViewModel habibWalletVM; late HabibWalletViewModel habibWalletVM;
late AppState appState;
final TextEditingController amountTextController = TextEditingController(); final TextEditingController amountTextController = TextEditingController();
@override @override
void initState() { void initState() {
scheduleMicrotask(() { scheduleMicrotask(() {
habibWalletVM.setDepositorDetails(appState.getAuthenticatedUser()!.patientId.toString(), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
appState.getAuthenticatedUser()!.mobileNumber!);
habibWalletVM.setSelectedRechargeType(0);
habibWalletVM.getProjectsList(); habibWalletVM.getProjectsList();
}); });
super.initState(); super.initState();
@ -47,7 +51,7 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
habibWalletVM = Provider.of<HabibWalletViewModel>(context, listen: false); habibWalletVM = Provider.of<HabibWalletViewModel>(context, listen: false);
AppState appState = getIt.get<AppState>(); appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: Column( body: Column(
@ -136,8 +140,8 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.myAccount.tr(context: context).toText16(color: AppColors.textColor, weight: FontWeight.w500), (habibWalletVM.getSelectedRechargeTypeValue()).toText16(color: AppColors.textColor, weight: FontWeight.w500),
"${LocaleKeys.medicalFile.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}" "${LocaleKeys.medicalFile.tr(context: context)}: ${habibWalletVM.fileNumber}"
.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500), .toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
], ],
), ),
@ -276,8 +280,8 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
); );
} else { } else {
habibWalletVM.setWalletRechargeAmount(num.parse(amountTextController.text)); habibWalletVM.setWalletRechargeAmount(num.parse(amountTextController.text));
habibWalletVM.setDepositorDetails(appState.getAuthenticatedUser()!.patientId.toString(), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}", // habibWalletVM.setDepositorDetails(appState.getAuthenticatedUser()!.patientId.toString(), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
appState.getAuthenticatedUser()!.mobileNumber!); // appState.getAuthenticatedUser()!.mobileNumber!);
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: WalletPaymentConfirmPage(), page: WalletPaymentConfirmPage(),

@ -87,13 +87,16 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
const Spacer(), const Spacer(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
).toShimmer2(isShow: false), height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: false),
),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
@ -126,13 +129,16 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
), ),
SizedBox(width: 8.h), SizedBox(width: 8.h),
const Spacer(), const Spacer(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18.h, icon: AppAssets.forward_arrow_icon,
height: 13.h, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18.h,
).toShimmer2(isShow: false), height: 13.h,
fit: BoxFit.contain,
).toShimmer2(isShow: false),
),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.h, 0.h).onPress(() {
@ -189,7 +195,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
if (Utils.havePrivilege(103)) { if (Utils.havePrivilege(103)) {
startApplePay(); startApplePay();
} else { } else {
openPaymentURL("applepay"); openPaymentURL("ApplePay");
} }
}) })
: SizedBox(height: 12.h), : SizedBox(height: 12.h),
@ -214,8 +220,8 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
applePayInsertRequest.clinicID = 0; applePayInsertRequest.clinicID = 0;
applePayInsertRequest.currency = appState.getAuthenticatedUser()!.outSa! == 0 ? "SAR" : "AED"; applePayInsertRequest.currency = appState.getAuthenticatedUser()!.outSa! == 0 ? "SAR" : "AED";
applePayInsertRequest.customerEmail = "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com"; applePayInsertRequest.customerEmail = "CustID_${habibWalletVM.fileNumber.toString()}@HMG.com";
applePayInsertRequest.customerID = appState.getAuthenticatedUser()!.patientId.toString(); applePayInsertRequest.customerID = habibWalletVM.fileNumber.toString();
applePayInsertRequest.customerName = "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}"; applePayInsertRequest.customerName = "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}";
applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken); applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
@ -224,7 +230,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
applePayInsertRequest.projectID = habibWalletVM.selectedHospital!.iD!.toString(); applePayInsertRequest.projectID = habibWalletVM.selectedHospital!.iD!.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3; applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString(); applePayInsertRequest.patientID = habibWalletVM.fileNumber.toString();
applePayInsertRequest.patientTypeID = appState.getAuthenticatedUser()!.patientType; applePayInsertRequest.patientTypeID = appState.getAuthenticatedUser()!.patientType;
applePayInsertRequest.patientOutSA = appState.getAuthenticatedUser()!.outSa; applePayInsertRequest.patientOutSA = appState.getAuthenticatedUser()!.outSa;
applePayInsertRequest.appointmentDate = null; applePayInsertRequest.appointmentDate = null;
@ -237,7 +243,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
applePayInsertRequest.isSchedule = "0"; applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = appState.isArabic() ? 'ar' : 'en'; applePayInsertRequest.language = appState.isArabic() ? 'ar' : 'en';
applePayInsertRequest.languageID = appState.isArabic() ? 1 : 2; applePayInsertRequest.languageID = appState.isArabic() ? 1 : 2;
applePayInsertRequest.userName = appState.getAuthenticatedUser()!.patientId; applePayInsertRequest.userName = int.parse(habibWalletVM.fileNumber);
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay"; applePayInsertRequest.paymentOption = "ApplePay";
@ -330,6 +336,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
}, },
onError: (err) {}); onError: (err) {});
} else { } else {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation), child: Utils.getErrorWidget(loadingText: "Payment Failed! Please try again.".needTranslation),
@ -403,11 +410,11 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> {
"Advance Payment", "Advance Payment",
transID, transID,
habibWalletVM.selectedHospital!.iD!.toString(), habibWalletVM.selectedHospital!.iD!.toString(),
"CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com", "CustID_${habibWalletVM.fileNumber.toString()}@HMG.com",
selectedPaymentMethod, selectedPaymentMethod,
appState.getAuthenticatedUser()!.patientType.toString(), appState.getAuthenticatedUser()!.patientType.toString(),
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}", habibWalletVM.depositorName,
appState.getAuthenticatedUser()!.patientId.toString(), habibWalletVM.fileNumber.toString(),
appState.getAuthenticatedUser()!, appState.getAuthenticatedUser()!,
browser!, browser!,
false, false,

@ -35,12 +35,15 @@ class HospitalListItemAdvancePayment extends StatelessWidget {
children: [hospitalName], children: [hospitalName],
), ),
), ),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
iconColor: AppColors.blackColor, child: Utils.buildSvgWithAssets(
width: 18, icon: AppAssets.forward_arrow_icon,
height: 13, iconColor: AppColors.blackColor,
fit: BoxFit.contain, width: 18,
height: 13,
fit: BoxFit.contain,
),
), ),
], ],
).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(16.h, 16.h),

@ -29,6 +29,7 @@ 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/habib_wallet/habib_wallet_view_model.dart'; import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_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/services/dialog_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/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
@ -43,6 +44,7 @@ class MultiPageBottomSheet extends StatefulWidget {
class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> { class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> {
late AppState appState; late AppState appState;
static final DialogService _dialogService = getIt.get<DialogService>();
TextEditingController fileNumberEditingController = TextEditingController(); TextEditingController fileNumberEditingController = TextEditingController();
@ -52,7 +54,7 @@ class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> {
return Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { return Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return Padding( return Padding(
padding: MediaQuery.of(context).viewInsets, padding: MediaQuery.of(context).viewInsets,
child: getCurrentIndexWidget(habibWalletVM), child: habibWalletVM.isBottomSheetContentLoading ? Utils.getLoadingWidget() : getCurrentIndexWidget(habibWalletVM),
); );
}); });
} }
@ -80,13 +82,12 @@ class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> {
labelText: LocaleKeys.fileNumber.tr(), labelText: LocaleKeys.fileNumber.tr(),
hintText: "xxxxxxxxx", hintText: "xxxxxxxxx",
controller: fileNumberEditingController, controller: fileNumberEditingController,
// focusNode: _nationalIdFocusNode,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
isAllowRadius: true, isAllowRadius: true,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
autoFocus: true, autoFocus: false,
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h),
leadingIcon: AppAssets.requests, leadingIcon: AppAssets.requests,
).withVerticalPadding(8), ).withVerticalPadding(8),
@ -94,9 +95,23 @@ class _MultiPageBottomSheetState extends State<MultiPageBottomSheet> {
CustomButton( CustomButton(
text: LocaleKeys.submit.tr(), text: LocaleKeys.submit.tr(),
onPressed: () async { onPressed: () async {
await habibWalletVM.getPatientInfoByPatientID(patientID: fileNumberEditingController.text, onSuccess: (response) { await habibWalletVM.getPatientInfoByPatientID(
print(response.data["GetPatientInfoByPatientIDList"][0]["FullName"]); patientID: fileNumberEditingController.text,
}, onError: (error) {}); onSuccess: (response) async {
print(response.data["GetPatientInfoByPatientIDList"][0]["FullName"]);
await _dialogService.showCommonBottomSheetWithoutH(
message: "A file was found with name: ${response.data["GetPatientInfoByPatientIDList"][0]["FullName"]}, Would you like to recharge wallet for this file number?".needTranslation,
label: LocaleKeys.notice.tr(),
onOkPressed: () {
habibWalletVM.setSelectedRechargeType(3);
habibWalletVM.setDepositorDetails(response.data["GetPatientInfoByPatientIDList"][0]["PatientID"].toString(), response.data["GetPatientInfoByPatientIDList"][0]["FullName"],
response.data["GetPatientInfoByPatientIDList"][0]["MobileNumber"]);
Navigator.of(context).pop();
Navigator.of(context).pop();
},
onCancelPressed: () {});
},
onError: (error) {});
}, },
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedBorderColor, borderColor: AppColors.primaryRedBorderColor,

@ -5,12 +5,14 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.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/app_state.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/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.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 '../../core/dependencies.dart';
class CollapsingListView extends StatelessWidget { class CollapsingListView extends StatelessWidget {
final String title; final String title;
@ -27,6 +29,7 @@ class CollapsingListView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
body: Column( body: Column(
@ -42,11 +45,14 @@ class CollapsingListView extends StatelessWidget {
surfaceTintColor: Colors.transparent, surfaceTintColor: Colors.transparent,
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
leading: isLeading leading: isLeading
? IconButton( ? Transform.flip(
icon: Utils.buildSvgWithAssets(icon: isClose ? AppAssets.closeBottomNav : AppAssets.arrow_back, width: 32.h, height: 32.h), flipX: appState.isArabic() ? true : false,
padding: EdgeInsets.only(left: 12), child: IconButton(
onPressed: () => Navigator.pop(context), icon: Utils.buildSvgWithAssets(icon: isClose ? AppAssets.closeBottomNav : AppAssets.arrow_back, width: 32.h, height: 32.h),
highlightColor: Colors.transparent, padding: EdgeInsets.only(left: 12),
onPressed: () => Navigator.pop(context),
highlightColor: Colors.transparent,
),
) )
: SizedBox.shrink(), : SizedBox.shrink(),
flexibleSpace: LayoutBuilder( flexibleSpace: LayoutBuilder(
@ -71,7 +77,7 @@ class CollapsingListView extends StatelessWidget {
t, t,
)!, )!,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: leftPadding, bottom: bottomPadding), padding: EdgeInsets.only(left: appState.isArabic() ? 0 : leftPadding, right: appState.isArabic() ? leftPadding : 0, bottom: bottomPadding),
child: Row( child: Row(
spacing: 4.h, spacing: 4.h,
children: [ children: [

@ -141,7 +141,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
labelText: "File no: ${appState.getAuthenticatedUser()!.patientId}", labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}",
), ),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.checkmark_icon, icon: AppAssets.checkmark_icon,
@ -167,7 +167,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
), ),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.blood_icon, icon: AppAssets.blood_icon,
labelText: "Blood: ${appState.getUserBloodGroup}", labelText: "${LocaleKeys.bloodType.tr(context: context)}: ${appState.getUserBloodGroup}",
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
), ),
], ],
@ -431,7 +431,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
), ),
), ),
// SizedBox(width: 40.h), // SizedBox(width: 40.h),
Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor), Transform.flip(
flipX: appState.isArabic() ? true : false,
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)),
], ],
).onPress(() { ).onPress(() {
prescriptionVM.setPrescriptionsDetailsLoading(); prescriptionVM.setPrescriptionsDetailsLoading();

@ -1,5 +1,7 @@
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';
@ -15,6 +17,7 @@ class LabRadCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: false), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: false),
child: Column( child: Column(
@ -49,13 +52,11 @@ class LabRadCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SizedBox.shrink(), SizedBox.shrink(),
Utils.buildSvgWithAssets( Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
width: 15.h, child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)
height: 15.h, .toShimmer2(isShow: false, radius: 12.h),
fit: BoxFit.contain, ),
iconColor: AppColors.textColor
).toShimmer2(isShow: false, radius: 12.h),
], ],
) )
], ],

@ -1,6 +1,8 @@
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_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/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.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';
@ -28,11 +30,14 @@ class MedicalFileAppointmentCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false).toText12().paddingSymmetrical(12.h, 0.h), richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)
.toText12(color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, fontWeight: FontWeight.w500)
.paddingOnly(left: 8.h),
icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon,
iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,
@ -115,11 +120,14 @@ class MedicalFileAppointmentCard extends StatelessWidget {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
child: Utils.buildSvgWithAssets( child: Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
width: 10.h, child: Utils.buildSvgWithAssets(
height: 10.h, icon: AppAssets.forward_arrow_icon,
fit: BoxFit.contain, width: 10.h,
height: 10.h,
fit: BoxFit.contain,
),
), ),
), ),
).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading).onPress(() { ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading).onPress(() {

@ -139,11 +139,14 @@ class PatientSickLeaveCard extends StatelessWidget {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
child: Utils.buildSvgWithAssets( child: Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: _appState.isArabic() ? true : false,
width: 10.h, child: Utils.buildSvgWithAssets(
height: 10.h, icon: AppAssets.forward_arrow_icon,
fit: BoxFit.contain, width: 10.h,
height: 10.h,
fit: BoxFit.contain,
),
), ),
), ),
).toShimmer2(isShow: isLoading).onPress(() { ).toShimmer2(isShow: isLoading).onPress(() {

@ -4,6 +4,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.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/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.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';
@ -42,6 +44,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false); prescriptionsViewModel = Provider.of<PrescriptionsViewModel>(context, listen: false);
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
@ -249,11 +252,14 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
child: Utils.buildSvgWithAssets( child: Transform.flip(
icon: AppAssets.forward_arrow_icon, flipX: appState.isArabic() ? true : false,
width: 10.h, child: Utils.buildSvgWithAssets(
height: 10.h, icon: AppAssets.forward_arrow_icon,
fit: BoxFit.contain, width: 10.h,
height: 10.h,
fit: BoxFit.contain,
),
), ),
), ),
).onPress(() { ).onPress(() {

@ -62,16 +62,19 @@ class CustomButton extends StatelessWidget {
children: [ children: [
if (icon != null) if (icon != null)
Padding( Padding(
padding: const EdgeInsets.only(right: 8.0, left: 8.0, bottom: 4.5), padding: const EdgeInsets.only(right: 8.0, left: 8.0),
child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconSize, height: iconSize), child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconSize, height: iconSize),
), ),
Text( Padding(
text, padding: EdgeInsets.only(top: 2.5),
style: context.dynamicTextStyle( child: Text(
fontSize: fontSize.fSize, text,
color: isDisabled ? textColor.withOpacity(0.5) : textColor, style: context.dynamicTextStyle(
letterSpacing: -0.4, fontSize: fontSize.fSize,
fontWeight: fontWeight, color: isDisabled ? textColor.withOpacity(0.5) : textColor,
letterSpacing: -0.4,
fontWeight: fontWeight,
),
), ),
), ),
], ],

Loading…
Cancel
Save