Merge pull request 'master' (#373) from master into Main_App_Replacement

Reviewed-on: #373
Main_App_Replacement
Haroon6138 3 weeks ago
commit c9401a2307

@ -28,21 +28,21 @@ class DateUtil {
const end = "+0300)";
final startIndex = date.indexOf(start);
final endIndex = date.indexOf(end, startIndex + start.length);
// if (projectId == 2 || projectId == 3) {
// return DateTime.fromMillisecondsSinceEpoch(
// int.parse(
// date.substring(startIndex + start.length, endIndex),
// ),
// isUtc: true)
// .add(Duration(hours: 4));
// } else {
return DateTime.fromMillisecondsSinceEpoch(
if (projectId == 2 || projectId == 3) {
return DateTime.fromMillisecondsSinceEpoch(
int.parse(
date.substring(startIndex + start.length, endIndex),
),
isUtc: true)
.add(Duration(hours: 4));
} else {
return DateTime.fromMillisecondsSinceEpoch(
int.parse(
date.substring(startIndex + start.length, endIndex),
),
isUtc: true)
.add(Duration(hours: 3));
// }
}
} else {
return DateTime.now();
}

@ -859,15 +859,15 @@ class Utils {
BoxFit fit = BoxFit.cover,
ImageErrorWidgetBuilder? errorBuilder,
}) {
final double? iconW = (width == null && height == null) ? 24.w : width;
final double? iconH = (width == null && height == null) ? 24.h : height;
if (url == null || url.isEmpty) {
return Utils.buildSvgWithAssets(
width: width ?? 24.w,
height: height ?? 24.h,
width: iconW ?? 24.w,
height: iconH ?? 24.h,
icon: AppAssets.noImageFound,
);
}
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
return PreserveImageColors(
child: Image.network(
url,
@ -877,7 +877,7 @@ class Utils {
errorBuilder: errorBuilder ??
(_, __, ___) {
//todo_section change the error builder icon that it is returning
return Utils.buildSvgWithAssets(width: iconW, height: iconH, icon: AppAssets.noImageFound);
return Utils.buildSvgWithAssets(width: iconW ?? 24.w, height: iconH ?? 24.h, icon: AppAssets.noImageFound);
},
),
);

@ -321,7 +321,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
icon: AppAssets.appointment_calendar_icon,
richText: widget.isLoading
? 'Cardiology'.toText10().toShimmer2(isShow: widget.isLoading)
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)}"
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)} ${(widget.patientAppointmentHistoryResponseModel.startTime != null && widget.patientAppointmentHistoryResponseModel.startTime!.isNotEmpty) ? widget.patientAppointmentHistoryResponseModel.startTime!.substring(0, 5) : DateUtil.formatDateToTimeLang(DateUtil.convertStringToDateSaudiTimezone(widget.patientAppointmentHistoryResponseModel.appointmentDate!, widget.patientAppointmentHistoryResponseModel.projectID), false)}"
.toText10(isEnglishOnly: true, isBold: true),
).toShimmer2(isShow: widget.isLoading),
),

@ -142,10 +142,7 @@ class AppointmentDoctorCard extends StatelessWidget {
child: AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),
icon: AppAssets.doctor_calendar_icon,
richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(
DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate),
false,
)}"
richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${(patientAppointmentHistoryResponseModel.startTime != null && patientAppointmentHistoryResponseModel.startTime!.isNotEmpty) ? patientAppointmentHistoryResponseModel.startTime!.substring(0, 5) : DateUtil.formatDateToTimeLang(DateUtil.convertStringToDateSaudiTimezone(patientAppointmentHistoryResponseModel.appointmentDate!, patientAppointmentHistoryResponseModel.projectID), false)}"
.toText10(isBold: true),
),
),

@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
@ -131,11 +130,14 @@ class LocationMapWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(24.r),
child: Utils.buildImgWithNetwork(
url: staticMapUrl,
width: double.infinity,
height: 165.h,
iconColor: AppColors.transparent,
fit: BoxFit.contain,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
return Container(
height: 165.h,
width: double.infinity,
decoration: BoxDecoration(
color: AppColors.bgScaffoldColor,
borderRadius: BorderRadius.circular(24.r),
@ -153,24 +155,23 @@ class LocationMapWidget extends StatelessWidget {
),
Positioned(
bottom: 0,
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.785,
child: CustomButton(
text: LocaleKeys.getDirections.tr(context: context),
onPressed: onDirectionsTap ?? _defaultLaunchDirections,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
borderColor: AppColors.textColor.withValues(alpha: 0.01),
textColor: AppColors.whiteColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h,
icon: AppAssets.directions_icon,
iconColor: AppColors.whiteColor,
iconSize: 14.h,
).paddingAll(12.h),
),
left: 0,
right: 0,
child: CustomButton(
text: LocaleKeys.getDirections.tr(context: context),
onPressed: onDirectionsTap ?? _defaultLaunchDirections,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
borderColor: AppColors.textColor.withValues(alpha: 0.01),
textColor: AppColors.whiteColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h,
icon: AppAssets.directions_icon,
iconColor: AppColors.whiteColor,
iconSize: 14.h,
).paddingAll(12.h),
),
],
),

Loading…
Cancel
Save