diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 5a098b6f..ea9af54d 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index fbef90e6..f45d2942 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 87d55b72..e846d31c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index e96ddcc7..78e13982 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 7984cbbf..3a59b21e 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 5328bfba..9cc194f1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -21,7 +21,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'location_page.dart'; diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 2008ef4c..c12cdb26 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -318,7 +318,7 @@ class RRTRequestPickupAddressPageState extends State { final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; int selectedStatusIndex = 5; var event = RobotProvider(); @@ -520,23 +520,23 @@ class _SendFeedbackPageState extends State { openSpeechReco() async { new RoboSearch(context: context).showAlertDialog(context); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // if (available) { + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - //SpeechToText.closeAlertDialog(context); - print(error); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // SpeechToText.closeAlertDialog(context); + // print(error); + // } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; @@ -556,14 +556,14 @@ class _SendFeedbackPageState extends State { setState(() { messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); }); } } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; + // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + // print(hasSpeech); + // if (!mounted) return; } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index dcc4b299..d93e0c3a 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 3d31e84b..c6e1685d 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -30,9 +30,9 @@ class LocalNotification { _initialize() { var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); - var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); + // var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); + // var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + // flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); } var _random = new Random(); @@ -55,11 +55,11 @@ class LocalNotification { Future.delayed(Duration(seconds: 1)).then((result) async { var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { - print(err); - }); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { + // print(err); + // }); }); } @@ -84,18 +84,18 @@ class LocalNotification { ledColor: const Color.fromARGB(255, 255, 0, 0), ledOnMs: 1000, ledOffMs: 500); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); // /change it to be as ionic - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); } ///Repeat notification every day at approximately 10:00:00 am Future showDailyAtTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showDailyAtTime( @@ -110,7 +110,7 @@ class LocalNotification { Future showWeeklyAtDayAndTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 03622a7a..04f4f851 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -33,9 +33,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_recognition_result.dart'; +// import 'package:speech_to_text/speech_to_text.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -47,7 +47,7 @@ class _SearchBot extends State { RobotProvider Provider = RobotProvider(); bool isLoading = false; bool isError = false; - final SpeechToText speech = SpeechToText(); + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -112,33 +112,33 @@ class _SearchBot extends State { } startVoiceSearch() async { - speech.listen( - onResult: resultListener, - listenFor: Duration(seconds: 10), - localeId: _currentLocaleId, - onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.confirmation); + // speech.listen( + // onResult: resultListener, + // listenFor: Duration(seconds: 10), + // localeId: _currentLocaleId, + // onSoundLevelChange: soundLevelListener, + // cancelOnError: true, + // partialResults: true, + // onDevice: true, + // listenMode: ListenMode.confirmation); } - void resultListener(SpeechRecognitionResult result) { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - - if (result.finalResult == true) { - // setState(() { - reconizedWord = result.recognizedWords; - //}); - setState(() { - searchController.text = reconizedWord; - }); - Future.delayed(const Duration(seconds: 1), () { - _speak(reconizedWord); - }); - } - //}); - } + // void resultListener(SpeechRecognitionResult result) { + // // lastWords = "${result.recognizedWords} - ${result.finalResult}"; + // + // if (result.finalResult == true) { + // // setState(() { + // reconizedWord = result.recognizedWords; + // //}); + // setState(() { + // searchController.text = reconizedWord; + // }); + // Future.delayed(const Duration(seconds: 1), () { + // _speak(reconizedWord); + // }); + // } + // //}); + // } Future _speak(reconizedWord) async { //await flutterTts.speak(reconizedWord); @@ -162,7 +162,7 @@ class _SearchBot extends State { } Future initSpeechState() async { - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' @@ -173,11 +173,11 @@ class _SearchBot extends State { // if (!mounted) return; } - void errorListener(SpeechRecognitionError error) { - //setState(() { - // reconizedWord = "${error.errorMsg} - ${error.permanent}"; - //}); - } + // void errorListener(SpeechRecognitionError error) { + // //setState(() { + // // reconizedWord = "${error.errorMsg} - ${error.permanent}"; + // //}); + // } void statusListener(String status) { //setState(() { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 10f30b71..5b2c995e 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -66,8 +66,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -83,7 +83,7 @@ class _FloatingSearchButton extends State with TickerProvi RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -235,18 +235,18 @@ class _FloatingSearchButton extends State with TickerProvi } startVoiceSearch() async { - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - - if (available) { - speech.listen( - onResult: resultListener, - //listenMode: ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + + // if (available) { + // speech.listen( + // onResult: resultListener, + // //listenMode: ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } // some time later... //speech.stop(); // speech.listen( @@ -305,7 +305,7 @@ class _FloatingSearchButton extends State with TickerProvi isArabic = Provider.of(context, listen: false).isArabic; await requestPermissions(); getUserData(); - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); //initialSpeak(); if (!mounted) return; @@ -315,10 +315,10 @@ class _FloatingSearchButton extends State with TickerProvi // }); } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - RoboSearch.closeAlertDialog(context); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // RoboSearch.closeAlertDialog(context); + // } void statusListener(String status) { //setState(() { @@ -951,7 +951,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); @override void initState() { @@ -1019,7 +1019,7 @@ class _MyStatefulBuilderState extends State { TranslationBase.of(context).ok, () { RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); // event.setValue({"searchText": { // 'isIOSFeedback':true, // diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index e5639f5c..d8aa1642 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart';