diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 664432fd..089f371b 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -301,7 +301,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 21.3; + static final double appVersionID = 21.4; // static final double appVersionID = 50.7; static final int appChannelId = 3; diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart index 2731cc1a..a27b727e 100644 --- a/lib/core/app_state.dart +++ b/lib/core/app_state.dart @@ -56,7 +56,7 @@ class AppState { void setIsPayfortHostedPageEnabled(bool value) { isPayfortHostedPageEnabled = value; - // isPayfortHostedPageEnabled = true; + // isPayfortHostedPageEnabled = false; } int? _superUserID; diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index bb6def9e..b51b36e4 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -1209,13 +1209,15 @@ class AuthenticationViewModel extends ChangeNotifier { } // Fetch profile image after switching user - await _fetchProfileImage(activation.list!.first.patientId); + // await _fetchProfileImage(activation.list!.first.patientId); + _fetchProfileImage(activation.list!.first.patientId); } else { activation.list!.first.isParentUser = true; _appState.addUserSwitchPayload(activation.list!.first.toJson(), isSuperUser: true); // Fetch profile image after login - await _fetchProfileImage(activation.list!.first.patientId); + // await _fetchProfileImage(activation.list!.first.patientId); + _fetchProfileImage(activation.list!.first.patientId); } activation.list!.first.bloodGroup = activation.patientBloodType; activation.list!.first.zipCode = selectedCountrySignup == CountryEnum.others ? '0' : selectedCountrySignup.countryCode; diff --git a/lib/features/smartwatch_health_data/health_data_transformations.dart b/lib/features/smartwatch_health_data/health_data_transformations.dart index 6f777353..1aeff65b 100644 --- a/lib/features/smartwatch_health_data/health_data_transformations.dart +++ b/lib/features/smartwatch_health_data/health_data_transformations.dart @@ -13,80 +13,90 @@ enum Durations { yearly("yearly"); final String value; + const Durations(this.value); } class HealthDataTransformation { - Map> transformVitalsToDataPoints(VitalsWRTType vitals, String filterType, String selectedSection,) { - final Map> dataPointMap = {}; + Map> transformVitalsToDataPoints( + VitalsWRTType vitals, + String filterType, + String selectedSection, + ) { + final Map> dataPointMap = {}; Map> data = vitals.getVitals(); // Group data based on the filter type Map> groupedData = {}; // List > items = data.values.toList(); List keys = data.keys.toList(); var count = 0; - List item = data[selectedSection] ?? []; + List item = data[selectedSection] ?? []; // for(var item in items) { - List dataPoints = []; - - for (var vital in item) { - String key = ""; - if (vital.value == "" || vital.timestamp == "") continue; - var parseDate = DateTime.parse(vital.timestamp); - var currentDate = normalizeToStartOfDay(DateTime.now()); - if (filterType == Durations.daily.value) { - if(isBetweenInclusive(parseDate, currentDate, DateTime.now())) { - key = DateFormat('yyyy-MM-dd HH').format(DateTime.parse(vital.timestamp)); - groupedData.putIfAbsent(key, () => []).add(vital); - }// Group by hour - } else if (filterType == Durations.weekly.value) { - if(isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: 7)), DateTime.now())) { - key = DateFormat('yyyy-MM-dd').format(DateTime.parse(vital.timestamp)); - groupedData.putIfAbsent(key, () => []).add(vital); - - } // Group by day - } else if (filterType == Durations.monthly.value) { - if(isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: 30)), DateTime.now())) { - print("the value for the monthly filter is ${vital.value} with the timestamp ${vital.timestamp} and the current date is $currentDate and the parse date is $parseDate"); - key = DateFormat('yyyy-MM-dd').format(DateTime.parse(vital.timestamp)); - groupedData.putIfAbsent(key, () => []).add(vital); - - } // Group by day - } else if (filterType == Durations.halfYearly.value || filterType == Durations.yearly.value) { - if(isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: filterType == Durations.halfYearly.value?180: 365)), DateTime.now())) { - key = DateFormat('yyyy-MM').format(DateTime.parse(vital.timestamp)); - groupedData.putIfAbsent(key, () => []).add(vital); - - } // Group by month - } else { - throw ArgumentError('Invalid filter type'); - } + List dataPoints = []; + + for (var vital in item) { + String key = ""; + if (vital.value == "" || vital.timestamp == "") continue; + + DateTime parseDate; + try { + parseDate = DateTime.parse(vital.timestamp); + } catch (e) { + print('Error parsing timestamp "${vital.timestamp}": $e'); + continue; // Skip this vital if timestamp is invalid + } + + var currentDate = normalizeToStartOfDay(DateTime.now()); + if (filterType == Durations.daily.value) { + if (isBetweenInclusive(parseDate, currentDate, DateTime.now())) { + key = DateFormat('yyyy-MM-dd HH').format(parseDate); + groupedData.putIfAbsent(key, () => []).add(vital); + } // Group by hour + } else if (filterType == Durations.weekly.value) { + if (isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: 7)), DateTime.now())) { + key = DateFormat('yyyy-MM-dd').format(parseDate); + groupedData.putIfAbsent(key, () => []).add(vital); + } // Group by day + } else if (filterType == Durations.monthly.value) { + if (isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: 30)), DateTime.now())) { + print("the value for the monthly filter is ${vital.value} with the timestamp ${vital.timestamp} and the current date is $currentDate and the parse date is $parseDate"); + key = DateFormat('yyyy-MM-dd').format(parseDate); + groupedData.putIfAbsent(key, () => []).add(vital); + } // Group by day + } else if (filterType == Durations.halfYearly.value || filterType == Durations.yearly.value) { + if (isBetweenInclusive(parseDate, currentDate.subtract(Duration(days: filterType == Durations.halfYearly.value ? 180 : 365)), DateTime.now())) { + key = DateFormat('yyyy-MM').format(parseDate); + groupedData.putIfAbsent(key, () => []).add(vital); + } // Group by month + } else { + throw ArgumentError('Invalid filter type'); } - print("the size of groupData is ${groupedData.values.length}"); - - // Process grouped data - groupedData.forEach((key, values) { - double sum = values.fold(0, (acc, v) => acc + num.parse(v.value)); - double mean = sum / values.length; - if(selectedSection == "bodyOxygen" || selectedSection == "bodyTemperature") { - mean = sum / values.length; - }else { - mean = sum; - } - - double finalValue = mean; - print("the final value is $finalValue for the key $key with the original values ${values.map((v) => v.value).toList()} and uom is ${values.first.unitOfMeasure}"); - dataPoints.add(DataPoint( - value: smartScale(finalValue), - label: key, - actualValue: finalValue.toStringAsFixed(2), - displayTime: key, - unitOfMeasurement:values.first.unitOfMeasure , - time: DateTime.parse(values.first.timestamp), - )); - }); - - dataPointMap[filterType] = dataPoints; + } + print("the size of groupData is ${groupedData.values.length}"); + + // Process grouped data + groupedData.forEach((key, values) { + double sum = values.fold(0, (acc, v) => acc + num.parse(v.value)); + double mean = sum / values.length; + if (selectedSection == "bodyOxygen" || selectedSection == "bodyTemperature") { + mean = sum / values.length; + } else { + mean = sum; + } + + double finalValue = mean; + print("the final value is $finalValue for the key $key with the original values ${values.map((v) => v.value).toList()} and uom is ${values.first.unitOfMeasure}"); + dataPoints.add(DataPoint( + value: smartScale(finalValue), + label: key, + actualValue: finalValue.toStringAsFixed(2), + displayTime: key, + unitOfMeasurement: values.first.unitOfMeasure, + time: DateTime.parse(values.first.timestamp), + )); + }); + + dataPointMap[filterType] = dataPoints; // } return dataPointMap; } @@ -109,10 +119,10 @@ class HealthDataTransformation { final random = Random(); // Smooth compression scaling - double baseScaled = number <20 ? number:100 * (number / (number + 100)); + double baseScaled = number < 20 ? number : 100 * (number / (number + 100)); // Random factor between 0.9 and 1.1 (±10%) - double randomFactor = number <20 ? random.nextDouble() * 1.5: 0.9 + random.nextDouble() * 0.2; + double randomFactor = number < 20 ? random.nextDouble() * 1.5 : 0.9 + random.nextDouble() * 0.2; double result = baseScaled * randomFactor; @@ -122,13 +132,12 @@ class HealthDataTransformation { DateTime normalizeToStartOfDay(DateTime date) { return DateTime(date.year, date.month, date.day); } + bool isBetweenInclusive( - DateTime target, - DateTime start, - DateTime end, - ) { + DateTime target, + DateTime start, + DateTime end, + ) { return !normalizeToStartOfDay(target).isBefore(start) && !normalizeToStartOfDay(target).isAfter(end); } - - -} \ No newline at end of file +} diff --git a/lib/features/smartwatch_health_data/health_service.dart b/lib/features/smartwatch_health_data/health_service.dart index 78411bfb..9e6c91b2 100644 --- a/lib/features/smartwatch_health_data/health_service.dart +++ b/lib/features/smartwatch_health_data/health_service.dart @@ -172,12 +172,12 @@ class HealthService { } } - void addWatchHelper(SmartWatchTypes watchType){ - watchHelper = CreateWatchHelper.getWatchName(watchType) ; + void addWatchHelper(SmartWatchTypes watchType) { + watchHelper = CreateWatchHelper.getWatchName(watchType); } Future> initDevice() async { - if(watchHelper == null){ + if (watchHelper == null) { return Result.error('No watch helper found'); } return await watchHelper!.initDevice(); @@ -197,14 +197,14 @@ class HealthService { await watchHelper!.getDistance(); await watchHelper!.getBloodOxygen(); Result data = await watchHelper!.retrieveData(); - if(data.isError) { + if (data.isError) { print('Unable to get the data'); } - var response = jsonDecode(data.asValue?.value?.toString()?.trim().replaceAll("\n", "")??""); - VitalsWRTType vitals = VitalsWRTType.fromMap(response); - log("the data is ${vitals}"); + var response = jsonDecode(data.asValue?.value?.toString()?.trim().replaceAll("\n", "") ?? ""); + VitalsWRTType vitals = VitalsWRTType.fromMap(response); + // log("the data is ${vitals}"); return vitals; - }catch(e){ + } catch (e) { print('Error getting heart rate: $e'); } return null; diff --git a/lib/features/smartwatch_health_data/model/vitals_data_model.dart b/lib/features/smartwatch_health_data/model/vitals_data_model.dart index ba1ac9f1..83cd4ea6 100644 --- a/lib/features/smartwatch_health_data/model/vitals_data_model.dart +++ b/lib/features/smartwatch_health_data/model/vitals_data_model.dart @@ -9,10 +9,22 @@ class Vitals { this.unitOfMeasure = "", }); + Map toJson() { + return { + 'value': value, + 'timestamp': timestamp, + 'uom': unitOfMeasure, + }; + } + factory Vitals.fromMap(Map map) { + String timestamp = map['timestamp'] ?? map['timeStamp'] ?? ""; + if (timestamp.isEmpty) { + timestamp = DateTime.now().toIso8601String(); + } return Vitals( value: map['value'] ?? "", - timestamp: map['timeStamp'] ?? "", + timestamp: timestamp, unitOfMeasure: map['uom'] ?? "", ); } diff --git a/lib/features/smartwatch_health_data/watch_connectors/health_connect_helper.dart b/lib/features/smartwatch_health_data/watch_connectors/health_connect_helper.dart index b77b5430..aeca1e87 100644 --- a/lib/features/smartwatch_health_data/watch_connectors/health_connect_helper.dart +++ b/lib/features/smartwatch_health_data/watch_connectors/health_connect_helper.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:async/src/result/result.dart'; import 'package:flutter/material.dart'; @@ -80,7 +81,10 @@ class HealthConnectHelper extends WatchHelper { @override Future retrieveData() async { + // String retData; + // retData = Result.value(getMappedData()) as String; return Result.value(getMappedData()); + // return retData; } @override @@ -151,9 +155,22 @@ class HealthConnectHelper extends WatchHelper { for (var point in data) { if (point.value is NumericHealthValue) { final numericValue = (point.value as NumericHealthValue).numericValue; + String timestamp = DateTime.now().toIso8601String(); + + try { + if (point.dateFrom != null) { + String tempTimestamp = point.dateFrom.toIso8601String(); + if (tempTimestamp.isNotEmpty) { + timestamp = tempTimestamp; + } + } + } catch (e) { + debugPrint('Error converting dateFrom to ISO8601 for $s: $e'); + } + Vitals vitals = Vitals( - value: (point.value as NumericHealthValue).numericValue.toStringAsFixed(2), - timestamp: point.dateFrom.toString() + value: numericValue.toStringAsFixed(2), + timestamp: timestamp ); mappedData[s]?.add(vitals); } @@ -165,17 +182,41 @@ class HealthConnectHelper extends WatchHelper { for (var point in data) { if (point.value is NumericHealthValue) { final numericValue = (point.value as NumericHealthValue).numericValue; + String timestamp = DateTime.now().toIso8601String(); + + try { + if (point.dateFrom != null) { + String tempTimestamp = point.dateFrom.toIso8601String(); + if (tempTimestamp.isNotEmpty) { + timestamp = tempTimestamp; + } + } + } catch (e) { + debugPrint('Error converting dateFrom to ISO8601 for $s: $e'); + } + point.value = NumericHealthValue( numericValue: numericValue * 100, ); - Vitals vitals = Vitals(value: (point.value as NumericHealthValue).numericValue.toStringAsFixed(2), timestamp: point.dateFrom.toString()); + Vitals vitals = Vitals( + value: (point.value as NumericHealthValue).numericValue.toStringAsFixed(2), + timestamp: timestamp + ); mappedData[s]?.add(vitals); } } } getMappedData() { - return " { \"heartRate\": ${mappedData["heartRate"] ?? []}, \"sleep\": ${mappedData["sleep"] ?? []}, \"steps\": ${mappedData["steps"] ?? []}, \"activity\": ${mappedData["activity"] ?? []}, \"bloodOxygen\": ${mappedData["bloodOxygen"] ?? []}, \"bodyTemperature\": ${mappedData["bodyTemperature"] ?? []}, \"distance\": ${mappedData["distance"] ?? []} }"; + return jsonEncode({ + "heartRate": (mappedData["heartRate"] ?? []).map((v) => v.toJson()).toList(), + "sleep": (mappedData["sleep"] ?? []).map((v) => v.toJson()).toList(), + "steps": (mappedData["steps"] ?? []).map((v) => v.toJson()).toList(), + "activity": (mappedData["activity"] ?? []).map((v) => v.toJson()).toList(), + "bloodOxygen": (mappedData["bloodOxygen"] ?? []).map((v) => v.toJson()).toList(), + "bodyTemperature": (mappedData["bodyTemperature"] ?? []).map((v) => v.toJson()).toList(), + "distance": (mappedData["distance"] ?? []).map((v) => v.toJson()).toList(), + }); } getHeartData(DateTime startDate, DateTime endDate, HealthDataType types) async { diff --git a/lib/presentation/book_appointment/search_doctor_by_name.dart b/lib/presentation/book_appointment/search_doctor_by_name.dart index 438cd746..165acfbf 100644 --- a/lib/presentation/book_appointment/search_doctor_by_name.dart +++ b/lib/presentation/book_appointment/search_doctor_by_name.dart @@ -212,6 +212,7 @@ class _SearchDoctorByNameState extends State { doctorsListResponseModel: bookAppointmentsVM.filteredDoctorList[index], isLoading: false, bookAppointmentsViewModel: bookAppointmentsViewModel, + isDoctorNameSearch: true, ).paddingSymmetrical(16.h, 0.h).onPress(() async { bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.filteredDoctorList[index]); LoaderBottomSheet.showLoader(); diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index 7a39bc3e..fe7cf3e0 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -10,13 +10,17 @@ 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/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart'; +import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/presentation/book_appointment/dental_chief_complaints_page.dart'; +import 'package:hmg_patient_app_new/presentation/book_appointment/laser/laser_appointment.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.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/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; +import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:lottie/lottie.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -25,11 +29,13 @@ class DoctorCard extends StatelessWidget { super.key, required this.doctorsListResponseModel, required this.isLoading, + this.isDoctorNameSearch = false, required this.bookAppointmentsViewModel, }); final DoctorsListResponseModel doctorsListResponseModel; final bool isLoading; + final bool isDoctorNameSearch; final BookAppointmentsViewModel bookAppointmentsViewModel; @@ -173,78 +179,47 @@ class DoctorCard extends StatelessWidget { CustomButton( text: LocaleKeys.bookAppo.tr(context: context), onPressed: () async { - bookAppointmentsViewModel.setSelectedDoctor(doctorsListResponseModel); - LoaderBottomSheet.showLoader(); - bookAppointmentsViewModel.isLiveCareSchedule - ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots( - isBookingForLiveCare: true, - onSuccess: (dynamic respData) async { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - title: LocaleKeys.pickADate.tr(context: context), - context, - child: AppointmentCalendar(), - isFullScreen: false, - isCloseButtonVisible: true, - callBackFunc: () {}, - ); - }, - onError: (err) { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: err), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); - }) - : await bookAppointmentsViewModel.getDoctorFreeSlots( - isBookingForLiveCare: false, - onSuccess: (dynamic respData) async { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - title: LocaleKeys.pickADate.tr(context: context), - context, - child: AppointmentCalendar(), - isFullScreen: false, - isCloseButtonVisible: true, - callBackFunc: () {}, - ); - }, - onError: (err) { - LoaderBottomSheet.hideLoader(); - if (bookAppointmentsViewModel.selectedClinic.clinicID == 23) { + if (isDoctorNameSearch && doctorsListResponseModel.clinicID == 17) { + GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel( + clinicID: doctorsListResponseModel.clinicID, clinicDescription: doctorsListResponseModel.clinicName, isLiveCareClinicAndOnline: false, liveCareServiceID: 0, liveCareClinicID: 0); + bookAppointmentsViewModel.setProjectID(doctorsListResponseModel.projectID.toString()); + bookAppointmentsViewModel.setSelectedClinic(selectedClinic); + bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true); + Navigator.of(context).push( + CustomPageRoute( + page: DentalChiefComplaintsPage(), + ), + ); + } else if (isDoctorNameSearch && doctorsListResponseModel.clinicID == 253) { + GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel( + clinicID: doctorsListResponseModel.clinicID, clinicDescription: doctorsListResponseModel.clinicName, isLiveCareClinicAndOnline: false, liveCareServiceID: 0, liveCareClinicID: 0); + bookAppointmentsViewModel.setSelectedClinic(selectedClinic); + bookAppointmentsViewModel.getLaserClinic(); + bookAppointmentsViewModel.setIsDoctorsListLoading(true); + Navigator.of(context).push( + CustomPageRoute( + page: LaserAppointment(), + ), + ); + } else { + bookAppointmentsViewModel.setSelectedDoctor(doctorsListResponseModel); + LoaderBottomSheet.showLoader(); + bookAppointmentsViewModel.isLiveCareSchedule + ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots( + isBookingForLiveCare: true, + onSuccess: (dynamic respData) async { + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( + title: LocaleKeys.pickADate.tr(context: context), context, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), - SizedBox(height: 8.h), - ("For booking appointments in the Physiotherapy clinic, please contact: 920066666").toText16(color: AppColors.blackColor), - SizedBox(height: 16.h), - CustomButton( - height: 40.h, - backgroundColor: AppColors.primaryRedColor, - borderColor: AppColors.primaryRedColor, - text: LocaleKeys.callNow.tr(), - textColor: AppColors.whiteColor, - iconColor: AppColors.whiteColor, - onPressed: () { - launchUrl( - Uri.parse("tel://920066666"), - ); - }, - icon: AppAssets.call), - ], - ).center, - callBackFunc: () {}, + child: AppointmentCalendar(), isFullScreen: false, isCloseButtonVisible: true, + callBackFunc: () {}, ); - } else { + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( context, child: Utils.getErrorWidget(loadingText: err), @@ -252,15 +227,70 @@ class DoctorCard extends StatelessWidget { isFullScreen: false, isCloseButtonVisible: true, ); - } - // showCommonBottomSheetWithoutHeight( - // context, - // child: Utils.getErrorWidget(loadingText: err), - // callBackFunc: () {}, - // isFullScreen: false, - // isCloseButtonVisible: true, - // ); - }); + }) + : await bookAppointmentsViewModel.getDoctorFreeSlots( + isBookingForLiveCare: false, + onSuccess: (dynamic respData) async { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.pickADate.tr(context: context), + context, + child: AppointmentCalendar(), + isFullScreen: false, + isCloseButtonVisible: true, + callBackFunc: () {}, + ); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + if (bookAppointmentsViewModel.selectedClinic.clinicID == 23) { + showCommonBottomSheetWithoutHeight( + context, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), + SizedBox(height: 8.h), + ("For booking appointments in the Physiotherapy clinic, please contact: 920066666").toText16(color: AppColors.blackColor), + SizedBox(height: 16.h), + CustomButton( + height: 40.h, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + text: LocaleKeys.callNow.tr(), + textColor: AppColors.whiteColor, + iconColor: AppColors.whiteColor, + onPressed: () { + launchUrl( + Uri.parse("tel://920066666"), + ); + }, + icon: AppAssets.call), + ], + ).center, + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } else { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + // showCommonBottomSheetWithoutHeight( + // context, + // child: Utils.getErrorWidget(loadingText: err), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); + }); + } }, backgroundColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA), diff --git a/lib/presentation/smartwatches/activity_detail.dart b/lib/presentation/smartwatches/activity_detail.dart index b023e04f..7911baf6 100644 --- a/lib/presentation/smartwatches/activity_detail.dart +++ b/lib/presentation/smartwatches/activity_detail.dart @@ -240,7 +240,8 @@ class _ActivityDetailsState extends State { return Selector>?>( selector: (_, model) => model.selectedData, builder: (_, data, __) { - if (context.read().selectedData.values.toList().first?.isEmpty == true) return SizedBox(); + // if (context.read().selectedData.values.toList().first.isEmpty == true) return SizedBox(); + if (context.read().selectedData.values.toList().isEmpty == true) return SizedBox(); return CustomBarChart( dataPoints: context.read().selectedData.values.toList().first, diff --git a/pubspec.yaml b/pubspec.yaml index ba0c0ed5..eafbd513 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,8 +2,8 @@ name: hmg_patient_app_new description: "New HMG Patient App" publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.0.37+36 -#version: 0.0.6+3 +#version: 0.0.38+37 +version: 0.0.7+1 environment: sdk: ">=3.6.0 <4.0.0"