HHC Fixes

merge-requests/599/merge
haroon amjad 3 years ago
parent f1129cc14c
commit a9e48e487f

@ -0,0 +1,13 @@
class AppState {
static final AppState _instance = AppState._internal();
AppState._internal();
factory AppState() => _instance;
bool isLogged = false;
set setLogged(v) => isLogged = v;
bool get getIsLogged => isLogged;
}

@ -141,11 +141,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null);
if (BASE_URL == "https://uat.hmgwebservices.com/") {
// if (BASE_URL == "https://uat.hmgwebservices.com/") {
print("URL : $url");
final jsonBody = json.encode(body);
print(jsonBody);
}
// }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
@ -264,72 +264,65 @@ class BaseAppClient {
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe
// headers = {
// 'Content-Type': 'application/json',
// 'Accept': 'application/json',
// 'Authorization': pharmacyToken,
// 'Mobilenumber': user['MobileNumber'].toString(),
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
// 'Username': user['PatientID'].toString(),
// };
}
}
// if (body.containsKey('SetupID')) {
// body['SetupID'] = body.containsKey('SetupID')
// ? body['SetupID'] != null
// ? body['SetupID']
// : SETUP_ID
// : SETUP_ID;
// }
//
// body['VersionID'] = VERSION_ID;
// body['Channel'] = CHANNEL;
// body['LanguageID'] = languageID == 'ar' ? 1 : 2;
//
// body['IPAdress'] = IP_ADDRESS;
// body['generalid'] = GENERAL_ID;
// body['PatientOutSA'] = body.containsKey('PatientOutSA')
// ? body['PatientOutSA'] != null
// ? body['PatientOutSA']
// : PATIENT_OUT_SA
// : PATIENT_OUT_SA;
//
// if (body.containsKey('isDentalAllowedBackend')) {
// body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
// ? body['isDentalAllowedBackend'] != null
// ? body['isDentalAllowedBackend']
// : IS_DENTAL_ALLOWED_BACKEND
// : IS_DENTAL_ALLOWED_BACKEND;
// }
//
// body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
//
// if (!body.containsKey('IsPublicRequest')) {
// body['PatientType'] = body.containsKey('PatientType')
// ? body['PatientType'] != null
// ? body['PatientType']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE
// : PATIENT_TYPE;
//
// body['PatientTypeID'] = body.containsKey('PatientTypeID')
// ? body['PatientTypeID'] != null
// ? body['PatientTypeID']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE_ID
// : PATIENT_TYPE_ID;
// if (user != null) {
// body['TokenID'] = token;
// body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
// body['PatientOutSA'] = user['OutSA'];
// body['SessionID'] = SESSION_ID; //getSe
// }
// }
}
// print("URL : $url");
// print("Body : ${json.encode(body)}");
// print("Headers : ${json.encode(headers)}");
print("URL : $url");
print("Body : ${json.encode(body)}");
print("Headers : ${json.encode(headers)}");
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -124,9 +124,9 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async {
// await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
});
// });
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
@ -47,6 +48,9 @@ class ProjectViewModel extends BaseViewModel {
List<PrivilegeModel> get privileges =>
isLoginChild ? privilegeChildUser : privilegeChildUser;
List<LaserBodyPart> selectedBodyPartList = [];
int laserSelectionDuration = 0;
StreamSubscription subscription;
ProjectViewModel() {

@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -42,6 +41,8 @@ class _LocationPageState extends State<LocationPage> {
double longitude = 0;
bool showCurrentLocation = false;
GoogleMapController mapController;
AppMap appMap;
AppSharedPreferences sharedPref = AppSharedPreferences();
static CameraPosition _kGooglePlex = CameraPosition(
@ -49,7 +50,7 @@ class _LocationPageState extends State<LocationPage> {
zoom: 14.4746,
);
LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer();
// Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace;
@override
@ -145,152 +146,156 @@ class _LocationPageState extends State<LocationPage> {
// ],
// ),
// PlacePicker(
// apiKey: GOOGLE_API_KEY,
// enableMyLocationButton: true,
// automaticallyImplyAppBarLeading: false,
// autocompleteOnTrailingWhitespace: true,
// selectInitialPosition: true,
// autocompleteLanguage: projectViewModel.currentLanguage,
// enableMapTypeButton: true,
// searchForInitialValue: false,
// onPlacePicked: (PickResult result) {
// print(result.adrAddress);
// },
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
// return isSearchBarFocused
// ? Container()
// : FloatingCard(
// bottomPosition: 0.0,
// leftPosition: 0.0,
// rightPosition: 0.0,
// width: 500,
// borderRadius: BorderRadius.circular(0.0),
// child: state == SearchingState.Searching
// ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
// : DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// customer: Customer(addresses: [
// Addresses(
// address1: selectedPlace.formattedAddress,
// address2: selectedPlace.formattedAddress,
// customerAttributes: "",
// createdOnUtc: "",
// id: "0",
// faxNumber: "",
// phoneNumber: projectViewModel.user.mobileNumber,
// countryId: 69,
// latLong: "$latitude,$longitude",
// email: projectViewModel.user.emailAddress)
// // Addresses(
// // address1: selectedPlace.formattedAddress,
// // address2: selectedPlace.formattedAddress,
// // customerAttributes: "",
// // city: "",
// // createdOnUtc: "",
// // id: "0",
// // latLong: "${selectedPlace.geometry.location}",
// // email: "")
// ]),
// );
//
// selectedPlace.addressComponents.forEach((e) {
// if (e.types.contains("country")) {
// addNewAddressRequestModel.customer.addresses[0].country = e.longName;
// }
// if (e.types.contains("postal_code")) {
// addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// }
// if (e.types.contains("locality")) {
// addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// }
// });
//
// await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: "Address Added Successfully");
// }
// Navigator.of(context).pop(addNewAddressRequestModel);
// }).insideContainer);
// },
// initialPosition: LatLng(latitude, longitude),
// useCurrentLocation: showCurrentLocation,
// ),
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onMapCreated: (GoogleMapController controller) {
mapController = controller;
},
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(0.0),
child: state == SearchingState.Searching
? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
: DefaultButton(TranslationBase.of(context).addNewAddress, () async {
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1: selectedPlace.formattedAddress,
address2: selectedPlace.formattedAddress,
customerAttributes: "",
createdOnUtc: "",
id: "0",
faxNumber: "",
phoneNumber: projectViewModel.user.mobileNumber,
countryId: 69,
latLong: selectedPlace.geometry.location.lat.toString() + "," + selectedPlace.geometry.location.lng.toString(),
email: projectViewModel.user.emailAddress)
// Addresses(
// address1: selectedPlace.formattedAddress,
// address2: selectedPlace.formattedAddress,
// customerAttributes: "",
// city: "",
// createdOnUtc: "",
// id: "0",
// latLong: "${selectedPlace.geometry.location}",
// email: "")
]),
);
Expanded(
child: Stack(
alignment: Alignment.center,
children: [
if (appMap != null) appMap,
Container(
margin: EdgeInsets.only(bottom: 50.0),
child: Icon(
Icons.place,
color: CustomColors.accentColor,
size: 50,
),
),
// FloatingCard(
// bottomPosition: 0.0,
// leftPosition: 0.0,
// rightPosition: 0.0,
// width: 500,
// borderRadius: BorderRadius.circular(0.0),
// // child: state == SearchingState.Searching
// // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
// // :
// child: DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// customer: Customer(addresses: [
// // Addresses(
// // address1: selectedPlace.formattedAddress,
// // address2: selectedPlace.formattedAddress,
// // customerAttributes: "",
// // createdOnUtc: "",
// // id: "0",
// // faxNumber: "",
// // phoneNumber: projectViewModel.user.mobileNumber,
// // countryId: 69,
// // latLong: "$latitude,$longitude",
// // email: projectViewModel.user.emailAddress)
//
// // Addresses(
// // address1: selectedPlace.formattedAddress,
// // address2: selectedPlace.formattedAddress,
// // customerAttributes: "",
// // city: "",
// // createdOnUtc: "",
// // id: "0",
// // latLong: "${selectedPlace.geometry.location}",
// // email: "")
// ]),
// );
//
// // selectedPlace.addressComponents.forEach((e) {
// // if (e.types.contains("country")) {
// // addNewAddressRequestModel.customer.addresses[0].country = e.longName;
// // }
// // if (e.types.contains("postal_code")) {
// // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// // }
// // if (e.types.contains("locality")) {
// // addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// // }
// // });
//
// await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: "Address Added Successfully");
// }
// Navigator.of(context).pop(addNewAddressRequestModel);
// }).insideContainer),
],
),
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer.addresses[0].city = e.longName;
}
});
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: "Address Added Successfully");
}
Navigator.of(context).pop(addNewAddressRequestModel);
}).insideContainer);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
// Expanded(
// child: Stack(
// alignment: Alignment.center,
// children: [
// if (appMap != null) appMap,
// Container(
// margin: EdgeInsets.only(bottom: 50.0),
// child: Icon(
// Icons.place,
// color: CustomColors.accentColor,
// size: 50,
// ),
// ),
// // FloatingCard(
// // bottomPosition: 0.0,
// // leftPosition: 0.0,
// // rightPosition: 0.0,
// // width: 500,
// // borderRadius: BorderRadius.circular(0.0),
// // // child: state == SearchingState.Searching
// // // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer
// // // :
// // child: DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// // AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
// // customer: Customer(addresses: [
// // // Addresses(
// // // address1: selectedPlace.formattedAddress,
// // // address2: selectedPlace.formattedAddress,
// // // customerAttributes: "",
// // // createdOnUtc: "",
// // // id: "0",
// // // faxNumber: "",
// // // phoneNumber: projectViewModel.user.mobileNumber,
// // // countryId: 69,
// // // latLong: "$latitude,$longitude",
// // // email: projectViewModel.user.emailAddress)
// //
// // // Addresses(
// // // address1: selectedPlace.formattedAddress,
// // // address2: selectedPlace.formattedAddress,
// // // customerAttributes: "",
// // // city: "",
// // // createdOnUtc: "",
// // // id: "0",
// // // latLong: "${selectedPlace.geometry.location}",
// // // email: "")
// // ]),
// // );
// //
// // // selectedPlace.addressComponents.forEach((e) {
// // // if (e.types.contains("country")) {
// // // addNewAddressRequestModel.customer.addresses[0].country = e.longName;
// // // }
// // // if (e.types.contains("postal_code")) {
// // // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
// // // }
// // // if (e.types.contains("locality")) {
// // // addNewAddressRequestModel.customer.addresses[0].city = e.longName;
// // // }
// // // });
// //
// // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
// // if (model.state == ViewState.ErrorLocal) {
// // Utils.showErrorToast(model.error);
// // } else {
// // AppToast.showSuccessToast(message: "Address Added Successfully");
// // }
// // Navigator.of(context).pop(addNewAddressRequestModel);
// // }).insideContainer),
// ],
// ),
// ),
),
);
}

@ -194,7 +194,10 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
longitude: longitude,
),
),
);
).then((value) {
print(value);
widget.model.getCustomerAddresses();
});
},
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -23,7 +22,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'book_reminder_page.dart';
@ -37,8 +35,9 @@ class BookConfirm extends StatefulWidget {
String appoDateFormatted = "";
String appoTimeFormatted = "";
bool isLiveCareAppointment;
int initialSlotDuration;
BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime});
BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime, @required this.initialSlotDuration});
DoctorsListService service;
PatientShareResponse patientShareResponse;
@ -208,7 +207,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor);
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
}
},
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@ -255,7 +254,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async {
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor);
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
@ -269,13 +268,13 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
insertAppointment(context, DoctorList docObject) {
insertAppointment(context, DoctorList docObject, int initialSlotDuration) {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel).then((res) {
if (res['MessageStatus'] == 1) {
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);

@ -154,7 +154,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
onTap: (index) {
setState(() {
if (index == 1) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) {
if (widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex;
showFooterButton = false;
} else {
@ -529,6 +529,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration,
),
),
);

@ -28,6 +28,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime;
bool isLiveCareAppointment;
final dynamic doctorSchedule;
static int initialSlotDuration;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
@ -239,6 +240,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
DocAvailableAppointments.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
DocAvailableAppointments.selectedAppoDateTime = DateUtil.convertStringToDate(freeSlotsResponse[0]);
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
selectedDateJSON = freeSlotsResponse[0];
});
@ -292,9 +294,9 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
DocAvailableAppointments.initialSlotDuration = res['InitialSlotDuration'];
DocAvailableAppointments.areAppointmentsAvailable = true;
freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) {
setState(() => {
_events.clear(),

@ -184,9 +184,11 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
Expanded(
child: DefaultButton(
TranslationBase.of(context).continues,
getDuration() != 0 ? () {
callDoctorsSearchAPI();
} : null,
getDuration() != 0
? () {
callDoctorsSearchAPI();
}
: null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
@ -208,6 +210,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService();
projectViewModel.selectedBodyPartList = _selectedBodyPartList;
service.getDoctorsList(253, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
@ -270,33 +273,14 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
if (_selectedBodyPartList.length > 0) {
duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration));
}
print("duration:$duration");
if (lowerUpperLegsList.length == 2) {
duration -= 30;
}
print("duration1:$duration");
if (upperLowerArmsList.length == 2) {
duration -= 15;
}
print("duration2:$duration");
// for (int i = 0; i < _selectedBodyPartList.length; i++) {
// if (
//
// (lowerUpperLegsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "47" || _selectedBodyPartList[i].mappingCode == "48")) ||
// (upperLowerArmsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "40" || _selectedBodyPartList[i].mappingCode == "41"))
//
//
// ) {
// print("duration:$duration");
//
// duration += 15;
// print("duration1:$duration");
// } else {
// duration += int.parse(_selectedBodyPartList[i].timeDuration);
// }
// }
print(duration);
_duration = duration;
projectViewModel.laserSelectionDuration = duration;
return duration;
}
@ -378,6 +362,9 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
setState(() {
if (value) {
_selectedBodyPartList.clear();
_selectedBodyPartList.add(fullBody);
} else {
_selectedBodyPartList.clear();
}
_isFullBody = !_isFullBody;
});

@ -435,7 +435,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID,
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID,
widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum)
.then((res) {
if (res['MessageStatus'] == 1) {

@ -359,7 +359,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(
docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, context, widget.obGyneProcedureListResponse.procedureId)
docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);

@ -3,10 +3,12 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
@ -28,6 +30,7 @@ class DoctorsListService extends BaseService {
double long;
String deviceToken;
String tokenID;
List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request;
@ -317,8 +320,8 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context,
[String procedureID, num testTypeEnum, num testProcedureEnum]) async {
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context,
[String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -339,13 +342,14 @@ class DoctorsListService extends BaseService {
"ProcedureID": procedureID,
"TestTypeEnum": testTypeEnum,
"TestProcedureEnum": testProcedureEnum,
"InitialSlotDuration": 0,
"InitialSlotDuration": initialSlotDuration,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"GenderID": authUser.gender,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -360,10 +364,18 @@ class DoctorsListService extends BaseService {
"PatientType": authUser.patientType
};
if(clinicID == 253) {
List<String> procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList();
request["GeneralProcedureList"] = procedureID;
request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration;
}
dynamic localRes;
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response;
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);

@ -142,6 +142,7 @@ class PushNotificationHandler {
newMessage(message);
});
else
// if(message != null)
newMessage(message);
});

@ -32,13 +32,13 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';

Loading…
Cancel
Save