|
|
|
|
@ -239,8 +239,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
|
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency ?? "ريال").toLowerCase() == "ريال")),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
// (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0")
|
|
|
|
|
(true)
|
|
|
|
|
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0")
|
|
|
|
|
// (true)
|
|
|
|
|
? CustomButton(
|
|
|
|
|
text: LocaleKeys.confirmLiveCare.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
@ -357,24 +357,25 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> askVideoCallPermission(BuildContext context) async {
|
|
|
|
|
final statuses = await LiveCarePermissionService.instance.requestCameraMicAndNotification(context);
|
|
|
|
|
final statuses = await LiveCarePermissionService.instance.requestCameraMicAndNotification(false, context);
|
|
|
|
|
|
|
|
|
|
// If service returned nothing (error), treat as not granted
|
|
|
|
|
if (statuses.isEmpty) return false;
|
|
|
|
|
|
|
|
|
|
bool cameraGranted = statuses[Permission.camera]?.isGranted ?? false;
|
|
|
|
|
bool micGranted = statuses[Permission.microphone]?.isGranted ?? false;
|
|
|
|
|
// bool cameraGranted = statuses[Permission.camera]?.isGranted ?? false;
|
|
|
|
|
// bool micGranted = statuses[Permission.microphone]?.isGranted ?? false;
|
|
|
|
|
bool notifGranted = statuses[Permission.notification]?.isGranted ?? false;
|
|
|
|
|
// bool alertWindowGranted = Platform.isAndroid ? (statuses[Permission.systemAlertWindow]?.isGranted ?? false) : true;
|
|
|
|
|
bool alertWindowGranted = true;
|
|
|
|
|
|
|
|
|
|
// If all required permissions are already granted
|
|
|
|
|
if (cameraGranted && micGranted && notifGranted && alertWindowGranted) return true;
|
|
|
|
|
// if (cameraGranted && micGranted && notifGranted && alertWindowGranted) return true;
|
|
|
|
|
if (notifGranted && alertWindowGranted) return true;
|
|
|
|
|
|
|
|
|
|
// Collect only the missing permissions
|
|
|
|
|
final missing = <Permission>[];
|
|
|
|
|
if (!cameraGranted) missing.add(Permission.camera);
|
|
|
|
|
if (!micGranted) missing.add(Permission.microphone);
|
|
|
|
|
// if (!cameraGranted) missing.add(Permission.camera);
|
|
|
|
|
// if (!micGranted) missing.add(Permission.microphone);
|
|
|
|
|
if (!notifGranted) missing.add(Permission.notification);
|
|
|
|
|
if (Platform.isAndroid && !alertWindowGranted) missing.add(Permission.systemAlertWindow);
|
|
|
|
|
|
|
|
|
|
@ -415,8 +416,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update grant state (preserve previously granted ones)
|
|
|
|
|
cameraGranted = newStatuses[Permission.camera]?.isGranted ?? cameraGranted;
|
|
|
|
|
micGranted = newStatuses[Permission.microphone]?.isGranted ?? micGranted;
|
|
|
|
|
// cameraGranted = newStatuses[Permission.camera]?.isGranted ?? cameraGranted;
|
|
|
|
|
// micGranted = newStatuses[Permission.microphone]?.isGranted ?? micGranted;
|
|
|
|
|
notifGranted = newStatuses[Permission.notification]?.isGranted ?? notifGranted;
|
|
|
|
|
alertWindowGranted = newStatuses[Permission.systemAlertWindow]?.isGranted ?? alertWindowGranted;
|
|
|
|
|
|
|
|
|
|
@ -435,7 +436,8 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// return cameraGranted && micGranted && notifGranted && alertWindowGranted;
|
|
|
|
|
return cameraGranted && micGranted && notifGranted;
|
|
|
|
|
// return cameraGranted && micGranted && notifGranted;
|
|
|
|
|
return notifGranted;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Future<bool> askVideoCallPermission() async {
|
|
|
|
|
|