diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 57362d6f..d4707aa9 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); - bool isIndoorNavigationEnabled = true; + bool isIndoorNavigationEnabled = false; int waitingAppointmentProjectID = 0; DoctorList? waitingAppointmentDoctor; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index f9cc30b4..a113e81b 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,6 +1,7 @@ import "dart:collection"; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; @@ -95,6 +96,7 @@ class _SearchByClinicState extends State { @override Widget build(BuildContext context) { + AppGlobal.context = context; return Container( child: SingleChildScrollView( child: Column( diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index 7c5d4542..72503cb4 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -89,71 +89,77 @@ class _SearchByHospitalState extends State { ), ), mHeight(8), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( - children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).selectHospital, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, + InkWell( + onTap: () { + openDropdown(projectDropdownKey); + }, + child: Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectHospital, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), ), - ), - Container( - height: 18, - width: double.infinity, - child: DropdownButtonHideUnderline( - child: DropdownButton( - hint: Text( - TranslationBase.of(context).selectHospital), - value: selectedHospital, - iconSize: 0, - isExpanded: true, - style: TextStyle( - fontSize: 14, - letterSpacing: -0.56, - color: Colors.black), - items: projectsList.map((HospitalsModel item) { - return DropdownMenuItem( - value: item, - child: AutoSizeText( - item.name!, - maxLines: 1, - minFontSize: 10, - style: TextStyle( - fontSize: SizeConfig.textMultiplier! * 1.6, - fontWeight: FontWeight.w600, - letterSpacing: -0.39, - height: 0.8, + Container( + height: 18, + width: double.infinity, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: Text( + TranslationBase.of(context).selectHospital), + value: selectedHospital, + iconSize: 0, + isExpanded: true, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + color: Colors.black), + items: projectsList.map((HospitalsModel item) { + return DropdownMenuItem( + value: item, + child: AutoSizeText( + item.name!, + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), ), - ), - // Text('${item.name!}'), - ); - }).toList(), - onChanged: (HospitalsModel? newValue) { - getClinicWrtHospital(newValue); - setState(() { - selectedHospital = newValue; - }); - }, + // Text('${item.name!}'), + ); + }).toList(), + onChanged: (HospitalsModel? newValue) { + getClinicWrtHospital(newValue); + setState(() { + selectedHospital = newValue; + }); + }, + ), ), ), - ), - ], + ], + ), ), - ), - Icon(Icons.keyboard_arrow_down), - ], - )), + Icon(Icons.keyboard_arrow_down), + ], + )), + ), if (clinicIds?.isNotEmpty == true) ...[ mHeight(8), InkWell( @@ -228,8 +234,23 @@ class _SearchByHospitalState extends State { void openDropdown(GlobalKey key) { GestureDetector? detector; - detector = searchForGestureDetector(key.currentContext!); + + void searchForGestureDetector(BuildContext element) { + element.visitChildElements((element) { + if (element.widget != null && element.widget is GestureDetector) { + detector = element.widget as GestureDetector?; + //return false; + } else { + searchForGestureDetector(element); + } + + //return true; + }); + } + + searchForGestureDetector(key.currentContext!); assert(detector != null); + detector!.onTap!(); } diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index 57ec961a..cf67bb57 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -108,10 +108,10 @@ class CalendarUtils { TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation); - // print("writableCalendars-name: " + writableCalendars.name); - // print("writableCalendars-Id: " + writableCalendars.id); - // print("writableCalendarsToString: " + writableCalendars.toString()); - // print("writableCalendarsToString: " + writableCalendars!.id!); + print("writableCalendars-name: " + writableCalendars.name); + print("writableCalendars-Id: " + writableCalendars.id); + print("writableCalendarsToString: " + writableCalendars.toString()); + print("writableCalendarsToString: " + writableCalendars!.id!); Event event = Event( writableCalendars!.id, start: scheduleDateTimeUTZ, @@ -119,11 +119,21 @@ class CalendarUtils { title: title, description: description, ); - await deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { - print("catchError " + e.toString()); - }).whenComplete(() { - print("whenComplete " + eventId!); - }); + + + if(Platform.isAndroid) { + Result result = await deviceCalendarPlugin.hasPermissions(); + print(result); + await deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { + print("catchError " + e.toString()); + }).whenComplete(() { + print("whenComplete Calender ID " + eventId!); + }); + } + + + + } deleteEvent(Calendar _calendar, Event _event) async {