Merge pull request 'fix: remove null safety operator from image URLs' (#360) from taha_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/360
master
Haroon6138 1 day ago
commit 1f6f4db456

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="120" height="120" fill="#EFF1F3"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.2503 38.4816C33.2603 37.0472 34.4199 35.8864 35.8543 35.875H83.1463C84.5848 35.875 85.7503 37.0431 85.7503 38.4816V80.5184C85.7403 81.9528 84.5807 83.1136 83.1463 83.125H35.8543C34.4158 83.1236 33.2503 81.957 33.2503 80.5184V38.4816ZM80.5006 41.1251H38.5006V77.8751L62.8921 53.4783C63.9172 52.4536 65.5788 52.4536 66.6039 53.4783L80.5006 67.4013V41.1251ZM43.75 51.6249C43.75 54.5244 46.1005 56.8749 49 56.8749C51.8995 56.8749 54.25 54.5244 54.25 51.6249C54.25 48.7254 51.8995 46.3749 49 46.3749C46.1005 46.3749 43.75 48.7254 43.75 51.6249Z" fill="#687787"/>
</svg>

After

Width:  |  Height:  |  Size: 892 B

@ -400,6 +400,7 @@ class AppAssets {
static const String descriptionIcon = '$svgBasePath/description_icon.svg';
static const String selectImageIcon = '$svgBasePath/select_image_icon.svg';
static const String patientQRCodeIcon = '$svgBasePath/patient_qr_code_icon.svg';
static const String noImageFound = '$svgBasePath/no_image_found.svg';
// PNGS //
static const String hmgLogo = '$pngBasePath/hmg_logo.png';

@ -851,7 +851,7 @@ class Utils {
/// Widget to build an image from network - automatically preserves colors in visual modes
static Widget buildImgWithNetwork({
required String url,
required String? url,
required Color iconColor,
bool isDisabled = false,
double? width,
@ -859,6 +859,13 @@ class Utils {
BoxFit fit = BoxFit.cover,
ImageErrorWidgetBuilder? errorBuilder,
}) {
if (url == null || url.isEmpty) {
return Utils.buildSvgWithAssets(
width: width ?? 24.w,
height: height ?? 24.h,
icon: AppAssets.noImageFound,
);
}
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
return PreserveImageColors(
@ -870,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.no_visit_icon);
return Utils.buildSvgWithAssets(width: iconW, height: iconH, icon: AppAssets.noImageFound);
},
),
);

@ -232,7 +232,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
Utils.buildImgWithNetwork(
url: widget.isLoading
? 'https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png'
: widget.patientAppointmentHistoryResponseModel.doctorImageURL!,
: widget.patientAppointmentHistoryResponseModel.doctorImageURL,
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,

@ -26,7 +26,7 @@ class BuildDoctorRowAppointmentRating extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: patientAppointmentHistoryResponseModel.doctorImageURL!,
url: patientAppointmentHistoryResponseModel.doctorImageURL,
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,

@ -88,7 +88,7 @@ class AskDoctorAppointmentCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildImgWithNetwork(
url: askDoctorAppointmentHistoryList.doctorImageURL!,
url: askDoctorAppointmentHistoryList.doctorImageURL,
iconColor: AppColors.blackBgColor,
width: 63.h,
height: 63.h,

@ -196,7 +196,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildImgWithNetwork(
url: myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL!,
url: myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL,
iconColor: AppColors.transparent,
width: 64.h,
height: 64.h,
@ -389,7 +389,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildImgWithNetwork(
url: myAppointmentsVM.patientFavouriteDoctorsList[index].doctorImageUrl!,
url: myAppointmentsVM.patientFavouriteDoctorsList[index].doctorImageUrl,
iconColor: AppColors.transparent,
width: 64.h,
height: 64.h,

@ -89,7 +89,7 @@ class DoctorProfilePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL!,
url: bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL,
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,
@ -116,7 +116,7 @@ class DoctorProfilePage extends StatelessWidget {
],
),
Utils.buildImgWithNetwork(
url: bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL!,
url: bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL,
iconColor: AppColors.transparent,
width: 32.h,
height: 32.h,

@ -260,7 +260,7 @@ class FeedbackPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: contactUsViewModel.patientFeedbackSelectedAppointment!.doctorImageURL!,
url: contactUsViewModel.patientFeedbackSelectedAppointment?.doctorImageURL??"",
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,

@ -84,7 +84,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: insuranceApprovalResponseModel.doctorImageURL!,
url: insuranceApprovalResponseModel.doctorImageURL,
iconColor: AppColors.blackBgColor,
width: 63.h,
height: 63.h,

@ -107,7 +107,7 @@ class InsuranceApprovalCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/OALAY/1439.png" : insuranceApprovalResponseModel.doctorImageURL!,
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/OALAY/1439.png" : insuranceApprovalResponseModel.doctorImageURL,
iconColor: AppColors.blackBgColor,
width: 63.h,
height: 63.h,

@ -56,7 +56,7 @@ class LabResultItemView extends StatelessWidget {
Row(
children: [
Utils.buildImgWithNetwork(
url: isLoading ? "" : labOrder!.doctorImageURL!,
url: isLoading ? "" : labOrder?.doctorImageURL??"",
iconColor: AppColors.transparent,
width: 24.h,
height: 24.h,

@ -926,7 +926,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: Row(
children: [
Utils.buildImgWithNetwork(
url: prescriptionVM.patientPrescriptionOrders[index].doctorImageURL!,
url: prescriptionVM.patientPrescriptionOrders[index].doctorImageURL,
iconColor: AppColors.transparent,
width: 40.h,
height: 40.h,
@ -1127,7 +1127,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Utils.buildImgWithNetwork(
url: myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL!,
url: myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL,
iconColor: AppColors.transparent,
width: 64.h,
height: 64.h,

@ -142,7 +142,7 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
mainAxisSize: MainAxisSize.min,
children: [
Utils.buildImgWithNetwork(
url: model.patientSickLeaveList[index].doctorImageURL!,
url: model.patientSickLeaveList[index].doctorImageURL,
iconColor: AppColors.transparent,
width: 24.h,
height: 24.h,

@ -57,7 +57,7 @@ class PatientSickLeaveCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : patientSickLeavesResponseModel.doctorImageURL!,
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : patientSickLeavesResponseModel.doctorImageURL,
iconColor: AppColors.transparent,
width: 30.h,
height: 30.h,

@ -43,7 +43,7 @@ class PatientMedicalReportCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : patientMedicalReportResponseModel.doctorImageURL!,
url: isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : patientMedicalReportResponseModel.doctorImageURL,
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,

@ -94,7 +94,7 @@ class OffersAndDiscountsDetailedPage extends StatelessWidget {
ClipRRect(
borderRadius: BorderRadius.circular(24.h),
child: Utils.buildImgWithNetwork(
url: offer.imageUrl!,
url: offer.imageUrl,
iconColor: AppColors.blackBgColor,
width: double.infinity,
height: 250.h,

@ -159,7 +159,7 @@ class _OffersAndDiscountsPageState extends State<OffersAndDiscountsPage> {
borderRadius: BorderRadius.vertical(top: Radius.circular(24.h)),
child: SizedBox.expand(
child: Utils.buildImgWithNetwork(
url: offersAndDiscountVM.filteredOffers[index].imageUrl!,
url: offersAndDiscountVM.filteredOffers[index].imageUrl,
iconColor: AppColors.blackBgColor,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {

@ -62,7 +62,7 @@ class PrescriptionDeliveryOrderSummaryPage extends StatelessWidget {
Radius.circular(5.r),
),
child: Utils.buildImgWithNetwork(
url: prescriptionsViewModel.prescriptionDetailsList[index].imageSRCUrl!,
url: prescriptionsViewModel.prescriptionDetailsList[index].imageSRCUrl,
iconColor: AppColors.blackBgColor,
fit: BoxFit.cover,
width: 60.w,

@ -126,7 +126,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
mainAxisSize: MainAxisSize.min,
children: [
Utils.buildImgWithNetwork(
url: widget.prescriptionsResponseModel.doctorImageURL!,
url: widget.prescriptionsResponseModel.doctorImageURL,
iconColor: AppColors.blackBgColor,
width: 24.h,
height: 24.h,

@ -43,7 +43,7 @@ class PrescriptionItemView extends StatelessWidget {
spacing: 8.h,
children: [
Utils.buildImgWithNetwork(
url: isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].imageThumbUrl!,
url: isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].imageThumbUrl,
iconColor: AppColors.blackBgColor,
width: 60.h,
height: 60.h,

@ -151,7 +151,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
mainAxisSize: MainAxisSize.min,
children: [
Utils.buildImgWithNetwork(
url: model.patientPrescriptionOrders[index].doctorImageURL!,
url: model.patientPrescriptionOrders[index].doctorImageURL,
iconColor: AppColors.blackBgColor,
width: 24.h,
height: 24.h,

@ -25,7 +25,7 @@ class BuildDoctorRow extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Utils.buildImgWithNetwork(
url: isForClinic ? 'https://hmgwebservices.com/Images/Hospitals/${appointmentDetails!.projectID}.jpg' : appointmentDetails!.doctorImageURL ,
url: isForClinic ? 'https://hmgwebservices.com/Images/Hospitals/${appointmentDetails?.projectID}.jpg' : appointmentDetails?.doctorImageURL ,
iconColor: AppColors.transparent,
width: 63.h,
height: 63.h,

@ -117,10 +117,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
chewie:
dependency: transitive
description:
@ -145,6 +145,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.2"
cloudflare_turnstile:
dependency: "direct main"
description:
name: cloudflare_turnstile
sha256: b3f2b7606a9d6eabfa38112ee4ae4272c4c75f16ed8e52d99fd01822e3ea0478
url: "https://pub.dev"
source: hosted
version: "3.8.1"
collection:
dependency: transitive
description:
@ -499,6 +507,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_amazonpaymentservices:
dependency: "direct main"
description:
name: flutter_amazonpaymentservices
sha256: "23f45fd3b1e12a0933da3704d66cebd19c4c41e28a50d4fd458d3e3e6311f332"
url: "https://pub.dev"
source: hosted
version: "0.0.13"
flutter_cache_manager:
dependency: transitive
description:
@ -700,10 +716,10 @@ packages:
dependency: "direct main"
description:
name: flutter_paytabs_bridge
sha256: fc48e68848147a8edf41b27f9068b988c4fb28ff9778bf20560a90be0b4dddfb
sha256: d65396883c661ea945a526c21b2fe859299f25fcd951fe3a733ff224e6ec984c
url: "https://pub.dev"
source: hosted
version: "2.7.13"
version: "2.7.14"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@ -720,6 +736,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.1"
flutter_screenshot_blocker:
dependency: "direct main"
description:
name: flutter_screenshot_blocker
sha256: "20e36b4aaca20259008dbb1403b77af6207d48cd8382a772b9c27619bc116849"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
flutter_staggered_animations:
dependency: "direct main"
description:
@ -1341,26 +1365,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.18.0"
mime:
dependency: transitive
description:
@ -1641,6 +1665,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
screen_brightness:
dependency: "direct main"
description:
name: screen_brightness
sha256: "7d4ac84ae26b37c01d6f5db7123a72db7933e1f2a2a8c369a51e08f81b3178d8"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
screen_brightness_android:
dependency: transitive
description:
name: screen_brightness_android
sha256: "8c69d3ac475e4d625e7fa682a3a51a69ff59abe5b4a9e57f6ec7d830a6c69bd6"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
screen_brightness_ios:
dependency: transitive
description:
name: screen_brightness_ios
sha256: f08f70ca1ac3e30719764b5cfb8b3fe1e28163065018a41b3e6f243ab146c2f1
url: "https://pub.dev"
source: hosted
version: "1.0.1"
screen_brightness_macos:
dependency: transitive
description:
name: screen_brightness_macos
sha256: "70c2efa4534e22b927e82693488f127dd4a0f008469fccf4f0eefe9061bbdd6a"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
screen_brightness_platform_interface:
dependency: transitive
description:
name: screen_brightness_platform_interface
sha256: "9f3ebf7f22d5487e7676fe9ddaf3fc55b6ff8057707cf6dc0121c7dfda346a16"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
screen_brightness_windows:
dependency: transitive
description:
name: screen_brightness_windows
sha256: c8e12a91cf6dd912a48bd41fcf749282a51afa17f536c3460d8d05702fb89ffa
url: "https://pub.dev"
source: hosted
version: "1.0.1"
scrollable_positioned_list:
dependency: "direct main"
description:
@ -1890,10 +1962,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.11"
time:
dependency: transitive
description:
@ -2175,5 +2247,5 @@ packages:
source: hosted
version: "1.2.0"
sdks:
dart: ">=3.9.0 <4.0.0"
dart: ">=3.10.0-0 <4.0.0"
flutter: ">=3.35.0"

Loading…
Cancel
Save