diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 2ea76b65..daf11a8f 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -35,7 +35,7 @@ class _NewEReferralStepTowPageState extends State { TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController(); String mobileNo = ""; - late GetAllCitiesResponseModel _selectedCity; + GetAllCitiesResponseModel _selectedCity =GetAllCitiesResponseModel(); late GetAllSharedRecordsByStatusList selectedPatientFamily; @@ -297,7 +297,7 @@ class _NewEReferralStepTowPageState extends State { } String getRelationName() { - if (_selectedCity != null) + if (_selectedCity?.description != null) return _selectedCity.description!; else return TranslationBase.of(context).selectCity /*TranslationBase.of(context).selectHospital*/; diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index 91c04833..60e719fd 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -24,19 +24,19 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S if (Platform.isAndroid) { if (await PermissionService.isCalendarPermissionEnabled()) { _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null); } else { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async { if (await Permission.calendarFullAccess.request().isGranted) { _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null); } }); } } else { if (await Permission.calendarFullAccess.request().isGranted) { _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? (int) {}); + onSuccess: onSuccess, title: title ?? "", description: description ?? "", onMultiDateSuccess: onMultiDateSuccess ?? null); } } } @@ -44,7 +44,7 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S final CalendarPlugin _myPlugin = CalendarPlugin(); Future _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, required String title, required String description, Function(int)? onMultiDateSuccess}) async { return showDialog( context: context, barrierDismissible: true, // user must tap button! @@ -77,7 +77,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String text = "2 hours"; } - if (onMultiDateSuccess == null) { + if (onMultiDateSuccess ==null) { CalendarUtils calendarUtils = await CalendarUtils.getInstance(); calendarUtils .createOrUpdateEvent( diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index b03a6db2..19ccae1e 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -47,7 +47,7 @@ class AddNewChildPage extends StatefulWidget { class _AddNewChildPageState extends State { late int tappedIndex; - late int checkedValue; + int checkedValue =0; @override void initState() { diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 769b6761..28094c14 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -34,11 +34,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profil import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:intl/intl.dart'; import 'package:map_launcher/map_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'dart:io'; +import 'package:huawei_map/huawei_map.dart' as hmsMap; + class AppointmentActions extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -55,10 +59,13 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; + static bool isHuawei =false; + late HmsApiAvailability hmsApiAvailability; @override void initState() { _getAppointmentActionButtons(); + checkIsHuawei(); super.initState(); } @@ -455,13 +462,22 @@ class _AppointmentActionsState extends State { static Future openMap(double latitude, double longitude) async { await MapLauncher.showMarker( - mapType: MapType.google, + mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple, coords: Coords(latitude, longitude), title: "Sulaiman Al Habib", description: "Appointment Location", ); } + checkIsHuawei() async { + if( Platform.isAndroid) { + await hmsApiAvailability.isHMSAvailable().then((value) { + isHuawei = value == 0 ? true : false; + hmsMap.HuaweiMapInitializer.initializeMap(); + }); + print(isHuawei); + } + } askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index d2da2564..c3e9e884 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -68,7 +68,6 @@ 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_to_text.dart'; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -144,7 +143,7 @@ class _FloatingSearchButton extends State with TickerProvi if (p['startPopUp'] == 'true') { if (this.mounted) { new RoboSearch(context: context).showAlertDialog(context); - // initSpeechState().then((value) => {startVoiceSearch()}); + initSpeechState().then((value) => {startVoiceSearch()}); } } }); @@ -259,16 +258,19 @@ class _FloatingSearchButton extends State with TickerProvi // } // some time later... if(available) { - speech.stop(); + + // speech.listen( onResult: resultListener ); + // speech.stop(); speech.listen( onResult: resultListener, listenFor: Duration(seconds: 10), localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.deviceDefault); + // cancelOnError: true, + // partialResults: true, + // onDevice: true, + // listenMode: stt.ListenMode.deviceDefault + ); } }