|
|
|
@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
@ -290,7 +291,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
|
|
|
|
|
} else {
|
|
|
|
|
askVideoCallPermission().then((value) async {
|
|
|
|
|
if (value) {
|
|
|
|
|
if (value == true) {
|
|
|
|
|
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
|
|
|
|
|
locationUtils.getCurrentLocation(callBack: (value) {
|
|
|
|
|
print(value);
|
|
|
|
@ -322,10 +323,29 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> askVideoCallPermission() async {
|
|
|
|
|
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
|
|
|
|
|
return false;
|
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
|
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
await showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (cxt) => CovidConsentDialog(
|
|
|
|
|
okTitle: TranslationBase.of(context).acceptLbl,
|
|
|
|
|
title: TranslationBase.of(context).covidConsentHeader,
|
|
|
|
|
message: TranslationBase.of(context).liveCarePermissions,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
// if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openPermissionsDialog() {
|
|
|
|
@ -342,6 +362,17 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openPermissionsConsentDialog() {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (cxt) => CovidConsentDialog(
|
|
|
|
|
okTitle: TranslationBase.of(context).acceptLbl,
|
|
|
|
|
title: TranslationBase.of(context).covidConsentHeader,
|
|
|
|
|
message: TranslationBase.of(context).covidConsent,
|
|
|
|
|
onTap: () async {},
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future drawOverAppsMessageDialog(BuildContext context) async {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|