Updates & fixes

sultan_v3.3
haroon amjad 2 years ago
parent 0e01835327
commit 6bdb7a3305

@ -6,6 +6,7 @@
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

@ -863,7 +863,7 @@ const Map localizedValues = {
"question": {"en": "Question", "ar": "سؤال"}, "question": {"en": "Question", "ar": "سؤال"},
"message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"},
"feedback-type": {"en": "Feedback Type", "ar": "نوع الرسالة"}, "feedback-type": {"en": "Feedback Type", "ar": "نوع الرسالة"},
"compliment": {"en": "compliment", "ar": "شكوى"}, "compliment": {"en": "Appreciation", "ar": "تقدير"},
"suggestion": {"en": "Suggestion", "ar": "إقتراح"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"},
"your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقتراحك شكرا لك"}, "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقتراحك شكرا لك"},
"select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"}, "select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"},
@ -1843,7 +1843,7 @@ const Map localizedValues = {
"privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"},
"termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"},
"prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."},
"liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."}, "liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."},
"lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" },
"lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" },
"lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" },

@ -340,8 +340,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}); });
} }
}, },
color: Color(0xffD02127), color: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xffEAEAEA) : Color(0xffD02127),
textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, textColor: Colors.white,
disabledColor: Color(0xffEAEAEA), disabledColor: Color(0xffEAEAEA),
), ),
), ),
@ -405,8 +405,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
color: Color(0xff575757), color: Color(0xff575757),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
suffixIconConstraints: BoxConstraints(minWidth: 50), // suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), // suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,

@ -49,7 +49,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
void dispose() { void dispose() {
_animationController.dispose(); _animationController.dispose();
player.stop(); player.stop();
_controller.dispose(); // _controller.dispose();
disposeAudioResources(); disposeAudioResources();
super.dispose(); super.dispose();
} }
@ -62,17 +62,17 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
body: FutureBuilder<void>( body: FutureBuilder<void>(
future: _initializeControllerFuture, future: _initializeControllerFuture,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { // if (snapshot.connectionState == ConnectionState.done) {
return Stack( return Stack(
alignment: FractionalOffset.center, alignment: FractionalOffset.center,
children: <Widget>[ children: <Widget>[
new Positioned.fill( // new Positioned.fill(
child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)), // child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)),
), // ),
new Positioned.fill( new Positioned.fill(
child: new ClipRect( child: new ClipRect(
child: new BackdropFilter( // child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), // filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container( child: new Container(
decoration: new BoxDecoration(color: Colors.grey[800].withOpacity(0.8)), decoration: new BoxDecoration(color: Colors.grey[800].withOpacity(0.8)),
child: Column( child: Column(
@ -191,29 +191,18 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
), ),
), ),
), ),
), // ),
], ],
); );
} else { // } else {
return const Center(child: CircularProgressIndicator()); // return const Center(child: CircularProgressIndicator());
} // }
}, },
), ),
); );
} }
void _runAnimation() async { void _runAnimation() async {
final cameras = await availableCameras();
final firstCamera = cameras[1];
_controller = CameraController(
// Get a specific camera from the list of available cameras.
firstCamera,
// Define the resolution to use.
ResolutionPreset.medium,
);
_initializeControllerFuture = _controller.initialize();
setState(() { setState(() {
isCameraReady = true; isCameraReady = true;
}); });
@ -229,7 +218,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
try { try {
// backToHome(); // backToHome();
// final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity); // final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity);
await _controller.dispose(); // await _controller.dispose();
changeCallStatusAPI(4); changeCallStatusAPI(4);
await Navigator.of(context).pushReplacement( await Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(

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

@ -14,10 +14,10 @@ class AppPermission{
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) { if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) {
return false; return false;
} }
if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { // if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) {
await _drawOverAppsMessageDialog(context); // await _drawOverAppsMessageDialog(context);
return false; // return false;
} // }
return true; return true;
} }

@ -22,6 +22,7 @@ import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_push/huawei_push.dart' as h_push; import 'package:huawei_push/huawei_push.dart' as h_push;
import 'package:permission_handler/permission_handler.dart';
import 'app_shared_preferences.dart'; import 'app_shared_preferences.dart';
import 'navigation_service.dart'; import 'navigation_service.dart';
@ -236,6 +237,11 @@ class PushNotificationHandler {
if (Platform.isIOS) { if (Platform.isIOS) {
final permission = await FirebaseMessaging.instance.requestPermission(); final permission = await FirebaseMessaging.instance.requestPermission();
if (permission.authorizationStatus == AuthorizationStatus.denied) return; if (permission.authorizationStatus == AuthorizationStatus.denied) return;
} else {
// await Permission.notification.request().then((value) {
// }).catchError((err) {
// print(err);
// });
} }
// 'Android HMS' (Handle Huawei Push_Kit Streams) // 'Android HMS' (Handle Huawei Push_Kit Streams)
@ -245,15 +251,21 @@ class PushNotificationHandler {
// } else { // } else {
// 'Android GMS or iOS' (Handle Firebase Messaging Streams // 'Android GMS or iOS' (Handle Firebase Messaging Streams
FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { try {
print("Firebase getInitialMessage with message : ${message.data.toString()}"); FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async {
subscribeFCMTopic(); if(message != null) {
if (Platform.isIOS) // print("Firebase getInitialMessage with message : ${message.data.toString()}");
await Future.delayed(Duration(milliseconds: 3000)).then((value) { subscribeFCMTopic();
if (message != null) newMessage(message); if (Platform.isIOS)
}); await Future.delayed(Duration(milliseconds: 3000)).then((value) {
else if (message != null) newMessage(message); if (message != null) newMessage(message);
}); });
else if (message != null) newMessage(message);
}
});
} catch(ex) {
}
FirebaseMessaging.onMessage.listen((RemoteMessage message) async { FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("Firebase onMessage!!!"); print("Firebase onMessage!!!");

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.5.008+4050008 version: 4.5.013+4050013
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -40,7 +40,7 @@ dependencies:
camera: ^0.10.1 camera: ^0.10.1
# Permissions # Permissions
permission_handler: ^8.3.0 permission_handler: ^10.2.0
# Flutter Html View # Flutter Html View
flutter_html: ^2.2.1 flutter_html: ^2.2.1

Loading…
Cancel
Save