updates & fixes

pull/181/head
haroon amjad 1 week ago
parent 92e745fe49
commit 9ed016ad8b

@ -188,7 +188,7 @@ class ApiClientImp implements ApiClient {
// body['SessionID'] = "45786230487560q";
}
// body['IsNewFlutterApp'] = true;
body['IsNewFlutterApp'] = true;
body.removeWhere((key, value) => value == null);
}

@ -904,7 +904,7 @@ class ApiConsts {
static String getPatientBloodAgreement = "Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation";
// ************ static values for Api ****************
static final double appVersionID = 50.3;
static final double appVersionID = 19.7;
static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20";
static final String appGeneralId = "Cs2020@2016\$2958";

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:get_it/get_it.dart';
import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/nationality_country_model.dart';
@ -1045,6 +1046,7 @@ class AuthenticationViewModel extends ChangeNotifier {
}
Future<void> getServicePrivilege() async {
ApiConsts.setBackendURLs();
final resultEither = await _authenticationRepo.getServicePrivilege();
List<ListPrivilege> privilegeModelList = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];

@ -806,6 +806,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
result.fold(
(failure) async {
print(failure);
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {

@ -104,6 +104,10 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
int? get selectedAge => _selectedAge;
setSelectedAge(int age) {
_selectedAge = age;
}
double? get selectedHeight => _selectedHeight;
bool get isHeightCm => _isHeightCm;

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -38,7 +39,7 @@ 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:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart';
import '../medical_file/widgets/medical_file_card.dart';
@ -228,9 +229,20 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.785,
child: CustomButton(
onPressed: () {
MapsLauncher.launchCoordinates(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!),
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!), widget.patientAppointmentHistoryResponseModel.projectName);
onPressed: () async {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!),
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!)),
title: widget.patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital",
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!),
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!)),
title: widget.patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital",
);
});
},
text: LocaleKeys.getDirections.tr(context: context),
backgroundColor: AppColors.textColor.withValues(alpha: 0.8),

@ -286,8 +286,20 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
} else {
//TODO: Add patient Derma package check API Here
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) {
print(err.data["ErrorEndUserMessage"]);
// print(err.data["ErrorEndUserMessage"]);
LoadingUtils.hideFullScreenLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: context),
context,
child: Utils.getErrorWidget(loadingText: err.toString()),
callBackFunc: () {
myAppointmentsViewModel.initAppointmentsViewModel();
myAppointmentsViewModel.getPatientAppointments(true, false);
// Navigator.pop(context);
},
isFullScreen: false,
isCloseButtonVisible: true,
);
}, onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async {

@ -1,4 +1,5 @@
import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -22,7 +23,7 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.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/map/location_map_widget.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart';
class CmcSelectionReviewPage extends StatefulWidget {
@ -319,16 +320,27 @@ class _CmcSelectionReviewPageState extends State<CmcSelectionReviewPage> {
CmcUiSelectionHelper.showHospitalSelectionBottomSheet(context: context, onHospitalSelected: (hospital) => context.pop());
}
void _launchDirections(HospitalsModel selectedHospital) {
void _launchDirections(HospitalsModel selectedHospital) async {
final double lat = double.parse(selectedHospital.latitude ?? "0.0");
final double lng = double.parse(selectedHospital.longitude ?? "0.0");
if (lat != 0.0 && lng != 0.0) {
MapsLauncher.launchCoordinates(
lat,
lng,
selectedHospital.name ?? "Hospital",
);
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(lat, lng),
title: selectedHospital.name ?? "Hospital",
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(lat, lng),
title: selectedHospital.name ?? "Hospital",
);
});
// MapsLauncher.launchCoordinates(
// lat,
// lng,
// selectedHospital.name ?? "Hospital",
// );
}
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -10,7 +12,7 @@ import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_h
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/widgets/chip/app_custom_chip_widget.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
class FindUsItemCard extends StatelessWidget {
@ -82,8 +84,18 @@ class FindUsItemCard extends StatelessWidget {
iconColor: AppColors.whiteColor,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
textColor: AppColors.whiteColor,
onChipTap: () {
MapsLauncher.launchCoordinates(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0"), getHMGLocationsModel.locationName!);
onChipTap: () async {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")),
title: getHMGLocationsModel.locationName ?? "Hospital",
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0")),
title: getHMGLocationsModel.locationName ?? "Hospital",
);
});
},
),
SizedBox(width: 4.w),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
@ -19,7 +21,7 @@ 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/map/location_map_widget.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart';
class HhcSelectionReviewPage extends StatefulWidget {
@ -142,9 +144,19 @@ class _HhcSelectionReviewPageState extends State<HhcSelectionReviewPage> {
);
}
void _launchDirectionsToLocation(double lat, double lng, String locationName) {
void _launchDirectionsToLocation(double lat, double lng, String locationName) async {
if (lat != 0.0 && lng != 0.0) {
MapsLauncher.launchCoordinates(lat, lng, locationName);
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(lat, lng),
title: locationName,
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(lat, lng),
title: locationName,
);
});
}
}

@ -1,4 +1,4 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -7,12 +7,12 @@ 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/qr_parking/models/qr_parking_response_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:map_launcher/map_launcher.dart';
import '../../features/qr_parking/qr_parking_view_model.dart';
import '../../theme/colors.dart';
import '../../widgets/appbar/app_bar_widget.dart';
import '../../widgets/buttons/custom_button.dart';
import '../../widgets/chip/app_custom_chip_widget.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import '../../widgets/routes/custom_page_route.dart';
@ -29,7 +29,7 @@ class ParkingSlot extends StatefulWidget {
}
class _ParkingSlotState extends State<ParkingSlot> {
void _openDirection() {
void _openDirection() async {
final lat = widget.model.latitude;
final lng = widget.model.longitude;
@ -48,7 +48,17 @@ class _ParkingSlotState extends State<ParkingSlot> {
return;
}
MapsLauncher.launchCoordinates(lat, lng);
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(lat, lng),
title: "Parking Location",
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(lat, lng),
title: "Parking Location",
);
});
}

@ -144,6 +144,7 @@ class _UserInfoSelectionPageState extends State<UserInfoSelectionPage> {
age--;
}
userAgeFromDOB = age;
getIt.get<SymptomsCheckerViewModel>().setSelectedAge(userAgeFromDOB);
} catch (e) {
// If date parsing fails, ignore
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
@ -8,7 +10,7 @@ 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';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
/// A reusable location map widget that displays a static map with address and directions button
/// Can be used in any review screen (HHC, CMC, etc.)
@ -56,9 +58,19 @@ class LocationMapWidget extends StatelessWidget {
this.padding,
});
void _defaultLaunchDirections() {
void _defaultLaunchDirections() async {
if (latitude != 0.0 && longitude != 0.0) {
MapsLauncher.launchCoordinates(latitude, longitude, address);
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(latitude, longitude),
title: address,
).catchError((err) {
MapLauncher.showMarker(
mapType: Platform.isIOS ? MapType.apple : MapType.google,
coords: Coords(latitude, longitude),
title: address,
);
});
}
}

@ -73,7 +73,7 @@ dependencies:
web: any
flutter_staggered_animations: ^1.1.1
smooth_corner: ^1.1.1
maps_launcher: ^3.0.0+1
map_launcher: ^4.4.3
amazon_payfort: ^1.1.4
network_info_plus: ^6.1.4
flutter_nfc_kit: ^3.6.0

Loading…
Cancel
Save