updates & fixes

pull/181/head
haroon amjad 2 months ago
parent 92e745fe49
commit 9ed016ad8b

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

@ -904,7 +904,7 @@ class ApiConsts {
static String getPatientBloodAgreement = "Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation"; static String getPatientBloodAgreement = "Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation";
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 50.3; static final double appVersionID = 19.7;
static final int appChannelId = 3; static final int appChannelId = 3;
static final String appIpAddress = "10.20.10.20"; static final String appIpAddress = "10.20.10.20";
static final String appGeneralId = "Cs2020@2016\$2958"; 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:flutter/services.dart' show rootBundle;
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.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/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/nationality_country_model.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 { Future<void> getServicePrivilege() async {
ApiConsts.setBackendURLs();
final resultEither = await _authenticationRepo.getServicePrivilege(); final resultEither = await _authenticationRepo.getServicePrivilege();
List<ListPrivilege> privilegeModelList = []; List<ListPrivilege> privilegeModelList = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = []; List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];

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

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

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.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/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.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: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 'package:provider/provider.dart';
import '../medical_file/widgets/medical_file_card.dart'; import '../medical_file/widgets/medical_file_card.dart';
@ -228,9 +229,20 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: SizedBox( child: SizedBox(
width: MediaQuery.of(context).size.width * 0.785, width: MediaQuery.of(context).size.width * 0.785,
child: CustomButton( child: CustomButton(
onPressed: () { onPressed: () async {
MapsLauncher.launchCoordinates(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!), await MapLauncher.showMarker(
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!), widget.patientAppointmentHistoryResponseModel.projectName); 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), text: LocaleKeys.getDirections.tr(context: context),
backgroundColor: AppColors.textColor.withValues(alpha: 0.8), backgroundColor: AppColors.textColor.withValues(alpha: 0.8),

@ -286,8 +286,20 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
} else { } else {
//TODO: Add patient Derma package check API Here //TODO: Add patient Derma package check API Here
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) { await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) {
print(err.data["ErrorEndUserMessage"]); // print(err.data["ErrorEndUserMessage"]);
LoadingUtils.hideFullScreenLoader(); 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 { }, onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader(); LoadingUtils.hideFullScreenLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async { await Future.delayed(Duration(milliseconds: 50)).then((value) async {

@ -1,4 +1,5 @@
import 'dart:developer'; import 'dart:developer';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.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/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.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: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'; import 'package:provider/provider.dart';
class CmcSelectionReviewPage extends StatefulWidget { class CmcSelectionReviewPage extends StatefulWidget {
@ -319,16 +320,27 @@ class _CmcSelectionReviewPageState extends State<CmcSelectionReviewPage> {
CmcUiSelectionHelper.showHospitalSelectionBottomSheet(context: context, onHospitalSelected: (hospital) => context.pop()); 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 lat = double.parse(selectedHospital.latitude ?? "0.0");
final double lng = double.parse(selectedHospital.longitude ?? "0.0"); final double lng = double.parse(selectedHospital.longitude ?? "0.0");
if (lat != 0.0 && lng != 0.0) { if (lat != 0.0 && lng != 0.0) {
MapsLauncher.launchCoordinates( await MapLauncher.showMarker(
lat, mapType: MapType.google,
lng, coords: Coords(lat, lng),
selectedHospital.name ?? "Hospital", 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:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.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: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'; import 'package:url_launcher/url_launcher.dart';
class FindUsItemCard extends StatelessWidget { class FindUsItemCard extends StatelessWidget {
@ -82,8 +84,18 @@ class FindUsItemCard extends StatelessWidget {
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
backgroundColor: AppColors.textColor.withValues(alpha: 0.8), backgroundColor: AppColors.textColor.withValues(alpha: 0.8),
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
onChipTap: () { onChipTap: () async {
MapsLauncher.launchCoordinates(double.parse(getHMGLocationsModel.latitude ?? "0.0"), double.parse(getHMGLocationsModel.longitude ?? "0.0"), getHMGLocationsModel.locationName!); 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), SizedBox(width: 4.w),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.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/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.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: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'; import 'package:provider/provider.dart';
class HhcSelectionReviewPage extends StatefulWidget { 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) { 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:easy_localization/easy_localization.dart';
import 'package:flutter/material.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/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/features/qr_parking/models/qr_parking_response_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.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 '../../features/qr_parking/qr_parking_view_model.dart';
import '../../theme/colors.dart'; import '../../theme/colors.dart';
import '../../widgets/appbar/app_bar_widget.dart'; import '../../widgets/appbar/app_bar_widget.dart';
import '../../widgets/buttons/custom_button.dart'; import '../../widgets/buttons/custom_button.dart';
import '../../widgets/chip/app_custom_chip_widget.dart'; import '../../widgets/chip/app_custom_chip_widget.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../widgets/routes/custom_page_route.dart'; import '../../widgets/routes/custom_page_route.dart';
@ -29,7 +29,7 @@ class ParkingSlot extends StatefulWidget {
} }
class _ParkingSlotState extends State<ParkingSlot> { class _ParkingSlotState extends State<ParkingSlot> {
void _openDirection() { void _openDirection() async {
final lat = widget.model.latitude; final lat = widget.model.latitude;
final lng = widget.model.longitude; final lng = widget.model.longitude;
@ -48,7 +48,17 @@ class _ParkingSlotState extends State<ParkingSlot> {
return; 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--; age--;
} }
userAgeFromDOB = age; userAgeFromDOB = age;
getIt.get<SymptomsCheckerViewModel>().setSelectedAge(userAgeFromDOB);
} catch (e) { } catch (e) {
// If date parsing fails, ignore // If date parsing fails, ignore
} }

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.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/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 /// 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.) /// Can be used in any review screen (HHC, CMC, etc.)
@ -56,9 +58,19 @@ class LocationMapWidget extends StatelessWidget {
this.padding, this.padding,
}); });
void _defaultLaunchDirections() { void _defaultLaunchDirections() async {
if (latitude != 0.0 && longitude != 0.0) { 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 web: any
flutter_staggered_animations: ^1.1.1 flutter_staggered_animations: ^1.1.1
smooth_corner: ^1.1.1 smooth_corner: ^1.1.1
maps_launcher: ^3.0.0+1 map_launcher: ^4.4.3
amazon_payfort: ^1.1.4 amazon_payfort: ^1.1.4
network_info_plus: ^6.1.4 network_info_plus: ^6.1.4
flutter_nfc_kit: ^3.6.0 flutter_nfc_kit: ^3.6.0

Loading…
Cancel
Save