updates & fixes

haroon_dev
haroon amjad 7 hours ago
parent 04db991851
commit 333f702f80

@ -382,7 +382,7 @@
"myWallet": "محفظتي",
"balanceAmount": "مبلغ المحفظة",
"totalBalance": "إجمالي الرصيد",
"createAdvancedPayment": "إعادة شحن المحفظة",
"createAdvancedPayment": "شحن المحفظة",
"advancePayment": "دفع مسبق",
"advancePaymentLabel": "يمكنك إنشاء وإضافة دفعة مقدمة لحسابك أو حسابات أخرى.",
"fileNumber": "رقم الملف",

@ -43,37 +43,36 @@ class CalenderUtilsNew {
}
Future<void> _loadCalendars() async {
print("the get calenders is called");
CalendarPermissionStatus result = await DeviceCalendar.instance.hasPermissions();
if (result != CalendarPermissionStatus.granted) {
await DeviceCalendar.instance.requestPermissions();
result = await DeviceCalendar.instance.hasPermissions();
// if (result != CalendarPermissionStatus.granted) {
// print("the permission is not granted");
// showCommonBottomSheetWithoutHeight(
// title: LocaleKeys.notice.tr(context: GetIt
// .instance<NavigationService>()
// .navigatorKey
// .currentContext!),
// GetIt
// .instance<NavigationService>()
// .navigatorKey
// .currentContext!,
// child: Utils.getWarningWidget(
// loadingText: LocaleKeys.calendarPermissionAlert.tr(),
// isShowActionButtons: true,
// onCancelTap: () {
// GetIt.instance<NavigationService>().pop();
// },
// onConfirmTap: () async {
// GetIt.instance<NavigationService>().pop();
// openAppSettings();
// }),
// callBackFunc: () {},
// isFullScreen: false,
// isCloseButtonVisible: true,
// );
// }
if (result != CalendarPermissionStatus.granted) {
print("the permission is not granted");
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: GetIt
.instance<NavigationService>()
.navigatorKey
.currentContext!),
GetIt
.instance<NavigationService>()
.navigatorKey
.currentContext!,
child: Utils.getWarningWidget(
loadingText: LocaleKeys.calendarPermissionAlert.tr(),
isShowActionButtons: true,
onCancelTap: () {
GetIt.instance<NavigationService>().pop();
},
onConfirmTap: () async {
GetIt.instance<NavigationService>().pop();
openAppSettings();
}),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
}
var calenders = await calender.listCalendars();
calenders.forEach((calender) {

@ -718,7 +718,7 @@ class HmgServicesViewModel extends ChangeNotifier {
result.fold(
(failure) async {
notifyListeners();
await errorHandlerService.handleError(failure: failure);
// await errorHandlerService.handleError(failure: failure);
if (onError != null) {
onError(failure.toString());
}

@ -134,11 +134,17 @@ class _NewReferralPageState extends State<NewReferralPage> {
onSuccess: (GenericApiModel response) {
LoaderBottomSheet.hideLoader();
showSuccessBottomSheet(int.parse(response.data), hmgServicesVM);
},
onError: (errorMessage) {
// Handle error (e.g., show error message)
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context,
title: LocaleKeys.error.tr(context: context),
child: Utils.getErrorWidget(
loadingText: errorMessage.toString(),
), callBackFunc: () {
Navigator.of(context).pop();
}, isFullScreen: false);
print(errorMessage);
},
);

@ -34,6 +34,7 @@ import 'package:hmg_patient_app_new/presentation/home/service_info_page.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart';
import 'package:hmg_patient_app_new/presentation/hmg_services/widgets/weather_widget.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart';
import 'package:hmg_patient_app_new/presentation/parking/paking_page.dart';
import 'package:hmg_patient_app_new/presentation/servicesPriceList/services_price_list_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
@ -586,7 +587,7 @@ class _ServicesPageState extends State<ServicesPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h, applyThemeColor: false),
LocaleKeys.medicalFile.tr().toText16(isBold: true, maxlines: 2).expanded,
LocaleKeys.familyTitle.tr().toText16(isBold: true, maxlines: 2).expanded,
Utils.buildSvgWithAssets(icon: getIt.get<AppState>().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward),
],
),
@ -653,9 +654,15 @@ class _ServicesPageState extends State<ServicesPage> {
],
).onPress(() async {
if (getIt.get<AppState>().isAuthenticated) {
// Navigator.of(context).push(
// CustomPageRoute(
// page: MedicalFilePage(),
// ),
// );
Navigator.of(context).push(
CustomPageRoute(
page: MedicalFilePage(),
direction: AxisDirection.down,
page: FamilyMedicalScreen(),
),
);
} else {

@ -1292,9 +1292,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Selector<MedicalFileViewModel,({bool isLoading, List<PatientMedicalReportResponseModel> listRequest, List<PatientMedicalReportResponseModel> listReady})>(
selector: (context, vm) => (isLoading: vm.isPatientMedicalReportsListLoading, listRequest: vm.patientMedicalReportRequestedList, listReady: vm.patientMedicalReportReadyList),
builder: (context, data, _){
print("isloading are ${data.isLoading}");
print("listRequest are ${data.listRequest}");
print("listReady are ${data.listReady}");
return MedicalReportCard(
isLoading: data.isLoading, listRequest: data.listRequest, listReady: data.listReady
);

@ -89,7 +89,8 @@ class MedicalReportCard extends StatelessWidget {
textColor: AppColors.primaryRedColor,
iconColor: AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
// fontWeight: FontWeight.w600,
isBold: true,
borderRadius: 12.r,
height: 48.h,
).toShimmer2(isShow: isLoading),

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'dart:ui' as ui;
class ScrollWheelTimePicker extends StatefulWidget {
@ -87,97 +88,99 @@ class _ScrollWheelTimePickerState extends State<ScrollWheelTimePicker> {
final digitStyle = widget.digitTextStyle ?? _defaultDigitStyle;
final separatorStyle = widget.separatorTextStyle ?? _defaultSeparatorStyle;
return SizedBox(
height: widget.pickerHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 150.w,
child: ListWheelScrollView.useDelegate(
controller: _hourController,
itemExtent: widget.itemExtent,
physics: const FixedExtentScrollPhysics(),
perspective: 0.005,
diameterRatio: 1.2,
onSelectedItemChanged: (index) {
setState(() {
_selectedHour =
widget.use24HourFormat ? index : index + 1;
});
_notifyChange();
},
childDelegate: ListWheelChildBuilderDelegate(
childCount: _maxHour,
builder: (context, index) {
final hour =
widget.use24HourFormat ? index : index + 1;
final isSelected = hour == _selectedHour;
return Visibility(
visible: true,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 200),
style: digitStyle.copyWith(
color: isSelected
? AppColors.textColor
: AppColors.textColor.withValues(alpha: 0.3),
),
child: Text(
hour.toString().padLeft(2, '0'),
return Directionality(
textDirection: ui.TextDirection.ltr,
child: SizedBox(
height: widget.pickerHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 150.w,
child: ListWheelScrollView.useDelegate(
controller: _hourController,
itemExtent: widget.itemExtent,
physics: const FixedExtentScrollPhysics(),
perspective: 0.005,
diameterRatio: 1.2,
onSelectedItemChanged: (index) {
setState(() {
_selectedHour =
widget.use24HourFormat ? index : index + 1;
});
_notifyChange();
},
childDelegate: ListWheelChildBuilderDelegate(
childCount: _maxHour,
builder: (context, index) {
final hour =
widget.use24HourFormat ? index : index + 1;
final isSelected = hour == _selectedHour;
return Visibility(
visible: true,
child: Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 200),
style: digitStyle.copyWith(
color: isSelected
? AppColors.textColor
: AppColors.textColor.withValues(alpha: 0.3),
),
child: Text(
hour.toString().padLeft(2, '0'),
),
),
),
),
);
},
);
},
),
),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 2.w),
child: Text(':', style: separatorStyle),
),
SizedBox(
width: 150.w,
child: ListWheelScrollView.useDelegate(
controller: _minuteController,
itemExtent: widget.itemExtent,
physics: const FixedExtentScrollPhysics(),
perspective: 0.005,
diameterRatio: 1.2,
onSelectedItemChanged: (index) {
setState(() {
_selectedMinute = index;
});
_notifyChange();
},
childDelegate: ListWheelChildBuilderDelegate(
childCount: 60,
builder: (context, index) {
final isSelected = index == _selectedMinute;
return Visibility(
visible: true,
child:
Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 200),
style: digitStyle.copyWith(
color: isSelected
? AppColors.textColor
: AppColors.transparent.withValues(alpha: 0.3),
),
child: Text(index.toString().padLeft(2, '0')),
),
));
Padding(
padding: EdgeInsets.symmetric(horizontal: 2.w),
child: Text(':', style: separatorStyle),
),
SizedBox(
width: 150.w,
child: ListWheelScrollView.useDelegate(
controller: _minuteController,
itemExtent: widget.itemExtent,
physics: const FixedExtentScrollPhysics(),
perspective: 0.005,
diameterRatio: 1.2,
onSelectedItemChanged: (index) {
setState(() {
_selectedMinute = index;
});
_notifyChange();
},
childDelegate: ListWheelChildBuilderDelegate(
childCount: 60,
builder: (context, index) {
final isSelected = index == _selectedMinute;
return Visibility(
visible: true,
child:
Center(
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 200),
style: digitStyle.copyWith(
color: isSelected
? AppColors.textColor
: AppColors.transparent.withValues(alpha: 0.3),
),
child: Text(index.toString().padLeft(2, '0')),
),
));
},
),
),
),
),
],
],
),
),
);
}

Loading…
Cancel
Save