Calender Fix Ios 17+

dev_v3.13.6_voipcall
devamirsaleemahmad 2 years ago
parent 1ddac14efb
commit fb62ce2f19

@ -94,7 +94,7 @@ class _BookSuccessState extends State<BookSuccess> {
widget.docObject.projectName!, widget.docObject.projectName!,
null, null,
null, null,
widget.docObject.nationalityFlagURL!, widget.docObject.nationalityFlagURL ?? "",
widget.docObject.doctorRate, widget.docObject.doctorRate,
null, null,
widget.docObject.noOfPatientsRate, widget.docObject.noOfPatientsRate,

@ -107,7 +107,7 @@ class _QRCodeState extends State<QRCode> {
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!, widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!,
widget.appointment!.doctorID!, widget.appointment!.doctorID ?? 0,
widget.appointment!.doctorImageURL!, widget.appointment!.doctorImageURL!,
widget.appointment!.doctorSpeciality!, widget.appointment!.doctorSpeciality!,
"", "",

@ -1,5 +1,6 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
@ -188,8 +189,6 @@ class _BookReminderPageState extends State<BookReminderPage> {
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
print(widget.patientShareResponse);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog( showReminderDialog(
context, context,
widget.dateTime!, widget.dateTime!,
@ -201,7 +200,8 @@ class _BookReminderPageState extends State<BookReminderPage> {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context); navigateToBookSuccess(context);
}, },
title: "" title: null,
description: null
); );
projectViewModel.analytics.appointment.appointment_reminder(true); projectViewModel.analytics.appointment.appointment_reminder(true);
}, },

@ -24,27 +24,25 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (await PermissionService.isCalendarPermissionEnabled()) { if (await PermissionService.isCalendarPermissionEnabled()) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} else { } else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async {
if (await Permission.calendarFullAccess.request().isGranted) { if (await Permission.calendarFullAccess.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} }
}); });
} }
} else { } else {
if (await Permission.calendarFullAccess.request().isGranted) { if (await Permission.calendarFullAccess.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess ?? (int) {});
} }
} }
} }
final CalendarPlugin _myPlugin = CalendarPlugin();
Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{required Function onSuccess, required String title, required String description, required Function(int) onMultiDateSuccess}) async { {required Function onSuccess, String? title, String? description, required Function(int) onMultiDateSuccess}) async {
return showDialog<void>( return showDialog<void>(
context: context, context: context,
barrierDismissible: true, // user must tap button! barrierDismissible: true, // user must tap button!
@ -77,17 +75,21 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
text = "2 hours"; text = "2 hours";
} }
if (onMultiDateSuccess == null) { if (onMultiDateSuccess.call(i) == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils try {
.createOrUpdateEvent( await calendarUtils.createOrUpdateEvent(
title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName, title: title ?? TranslationBase
description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted, .of(context)
scheduleDateTime: dateTime, .reminderTitle + " " + doctorName,
eventId: eventId) description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted,
.then((value) {}); scheduleDateTime: dateTime,
eventId: eventId);
onSuccess(); onSuccess();
}catch(e){
print(e);
}
} else { } else {
onMultiDateSuccess(i); onMultiDateSuccess(i);
} }

@ -393,10 +393,8 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async { await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
logger.d(error);
throw error; throw error;
}, body: request); }, body: request);
logger.d(localRes);
return Future.value(localRes); return Future.value(localRes);
} catch (e) { } catch (e) {
logger.d(e); logger.d(e);

@ -59,7 +59,7 @@ class CalendarUtils {
}); });
} }
Future createOrUpdateEvent({String? title, String? description, DateTime? scheduleDateTime, String? eventId}) async { Future createOrUpdateEvent({required String title, required String description, DateTime? scheduleDateTime, String? eventId}) async {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
@ -74,7 +74,7 @@ class CalendarUtils {
TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation); TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation);
// print("eventId: " + eventId); //print("eventId: " + eventId);
// print("writableCalendars-name: " + writableCalendars.name); // print("writableCalendars-name: " + writableCalendars.name);
// print("writableCalendars-Id: " + writableCalendars.id); // print("writableCalendars-Id: " + writableCalendars.id);
// print("writableCalendarsToString: " + writableCalendars.toString()); // print("writableCalendarsToString: " + writableCalendars.toString());

@ -121,7 +121,7 @@ dependencies:
flutter_datetime_picker_plus: ^2.1.0 flutter_datetime_picker_plus: ^2.1.0
carousel_pro_nullsafety: ^2.0.0 carousel_pro_nullsafety: ^2.0.0
flutter_local_notifications: any flutter_local_notifications: any
device_calendar: ^4.2.0 device_calendar: ^4.3.2
geolocator: ^9.0.2 geolocator: ^9.0.2
geocoding: ^2.0.1 geocoding: ^2.0.1
jiffy: ^6.2.1 jiffy: ^6.2.1

Loading…
Cancel
Save