diff --git a/.gitignore b/.gitignore index 4b016310..fd4aca5a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +health_calculators.dart diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 6264c7a8..ed93f626 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -65,35 +65,5 @@ class _SearchState extends State with TickerProviderStateMixin { ], ), )); - // Scaffold( - // appBar: AppBar( - // bottom: TabBar( - // labelColor: Colors.white, - // tabs: [ - // Tab(text: TranslationBase.of(context).clinicName), - // Tab( - // text: TranslationBase.of(context).doctorName, - // ) - // ], - // controller: _tabController, - // ), - // title: Text(TranslationBase.of(context).bookAppo, - // style: TextStyle(color: Colors.white)), - // leading: Builder( - // builder: (BuildContext context) { - // return ArrowBack(); - // }, - // ), - // ), - // body: TabBarView( - // physics: NeverScrollableScrollPhysics(), - // children: [ - // SearchByClinic( - // clnicIds: widget.clnicIds, - // ), - // SearchByDoctor() - // ], - // controller: _tabController), - // ); } } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 4d5d4d49..7aa0ff00 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -33,6 +33,7 @@ class _SearchByClinicState extends State { List projectsList = []; bool isMobileAppDentalAllow = false; bool isLoaded = false; + bool isProjectLoaded = false; @override void initState() { @@ -55,6 +56,11 @@ class _SearchByClinicState extends State { onChanged: (bool value) { setState(() { nearestAppo = value; + print(nearestAppo); + if (nearestAppo) + getProjectsList(); + else + isProjectLoaded = false; }); }, ), @@ -120,7 +126,8 @@ class _SearchByClinicState extends State { }, ), )), - isDentalSelectedAndSupported() == true || nearestAppo + isDentalSelectedAndSupported() == true || + (nearestAppo && isProjectLoaded) ? Container( height: 60.0, decoration: BoxDecoration( @@ -177,24 +184,30 @@ class _SearchByClinicState extends State { }); }); getProjectsList(); + GifLoaderDialogUtils.hideDialog(context); } else {} }).catchError((err) { print(err); + GifLoaderDialogUtils.hideDialog(context); }); } getProjectsList() { ClinicListService service = new ClinicListService(); + List projectsListLocal = []; service.getProjectsList(context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { - projectsList.add(new HospitalsModel.fromJson(v)); + projectsListLocal.add(new HospitalsModel.fromJson(v)); }); + projectsList = projectsListLocal; }); - GifLoaderDialogUtils.hideDialog(context); filterClinic(); - } else {} + isProjectLoaded = true; + } else { + isProjectLoaded = false; + } }).catchError((err) { print(err); }); @@ -235,10 +248,6 @@ class _SearchByClinicState extends State { doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - // arr.add(new DoctorList.fromJson(v).projectName); - // arrDistance.add(new DoctorList.fromJson(v) - // .projectDistanceInKiloMeters - // .toString()); }); doctorsList.forEach((element) { List doctorByHospital = @@ -269,8 +278,6 @@ class _SearchByClinicState extends State { result = LinkedHashSet.from(arr).toList(); numAll = result.length; - // navigateToSearchResults( - // context, doctorsList, result, numAll, arrDistance); navigateToSearchResults( context, doctorsList, _patientDoctorAppointmentListHospital); } else { @@ -299,6 +306,7 @@ class _SearchByClinicState extends State { List docList, List patientDoctorAppointmentListHospital) async { + isProjectLoaded = false; Navigator.push( context, MaterialPageRoute( @@ -313,7 +321,7 @@ class _SearchByClinicState extends State { filterClinic() { setState(() { - if (widget.clnicIds.length > 0) { + if (widget.clnicIds != null && widget.clnicIds.length > 0) { clinicsList = clinicsList .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) .toList(); diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a710e00c..136bd30f 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -2,13 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { - static var buttons = [ - // { - // "title": TranslationBase.of(AppGlobal.context).arrived, - // "subtitle": TranslationBase.of(AppGlobal.context).status, - // "icon": "assets/images/new-design/waiting-room.png", - // "caller": "openReschedule" - // }, + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).medicines, "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart index 1a76be63..709b3b1f 100644 --- a/lib/pages/MyAppointments/models/BookedButtons.dart +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class BookedButtons { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).confirm, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart index 374ebf45..9548b7c8 100644 --- a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class BookedButtonsAllowCheckIn { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).confirm, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/ConfirmedButtons.dart b/lib/pages/MyAppointments/models/ConfirmedButtons.dart index d5b7836e..b02021c7 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtons.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtons.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ConfirmedButtons { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart index 1368e3f3..07ba333e 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ConfirmedButtonsAllowCheckIn { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 7d985233..fb79b5ac 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -276,14 +276,15 @@ class _AppointmentActionsState extends State { Future> _getBookedAppoActionsList() async { print("_getBookedAppoActionsList"); - print(BookedButtons.buttons); + BookedButtons bookedButtons = new BookedButtons(); + print(bookedButtons.buttons); List buttonsList = []; - for (var i = 0; i < BookedButtons.buttons.length; i++) { + for (var i = 0; i < bookedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: BookedButtons.buttons[i]['title'], - subtitle: BookedButtons.buttons[i]['subtitle'], - icon: BookedButtons.buttons[i]['icon'], - caller: BookedButtons.buttons[i]['caller'], + title: bookedButtons.buttons[i]['title'], + subtitle: bookedButtons.buttons[i]['subtitle'], + icon: bookedButtons.buttons[i]['icon'], + caller: bookedButtons.buttons[i]['caller'], )); } setState(() { @@ -293,14 +294,16 @@ class _AppointmentActionsState extends State { Future> _getBookedCheckInAppoActionsList() async { print("_getBookedCheckInAppoActionsList"); - print(BookedButtonsAllowCheckIn.buttons); + BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn = + new BookedButtonsAllowCheckIn(); + print(bookedButtonsAllowCheckIn.buttons); List buttonsList = []; - for (var i = 0; i < BookedButtonsAllowCheckIn.buttons.length; i++) { + for (var i = 0; i < bookedButtonsAllowCheckIn.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: BookedButtonsAllowCheckIn.buttons[i]['title'], - subtitle: BookedButtonsAllowCheckIn.buttons[i]['subtitle'], - icon: BookedButtonsAllowCheckIn.buttons[i]['icon'], - caller: BookedButtonsAllowCheckIn.buttons[i]['caller'], + title: bookedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: bookedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: bookedButtonsAllowCheckIn.buttons[i]['icon'], + caller: bookedButtonsAllowCheckIn.buttons[i]['caller'], )); } setState(() { @@ -310,14 +313,15 @@ class _AppointmentActionsState extends State { Future> _getConfirmedAppoActionsList() async { print("_getConfirmedAppoActionsList"); - print(ConfirmedButtons.buttons); + ConfirmedButtons confirmedButtons = new ConfirmedButtons(); + print(confirmedButtons.buttons); List buttonsList = []; - for (var i = 0; i < ConfirmedButtons.buttons.length; i++) { + for (var i = 0; i < confirmedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ConfirmedButtons.buttons[i]['title'], - subtitle: ConfirmedButtons.buttons[i]['subtitle'], - icon: ConfirmedButtons.buttons[i]['icon'], - caller: ConfirmedButtons.buttons[i]['caller'], + title: confirmedButtons.buttons[i]['title'], + subtitle: confirmedButtons.buttons[i]['subtitle'], + icon: confirmedButtons.buttons[i]['icon'], + caller: confirmedButtons.buttons[i]['caller'], )); } setState(() { @@ -327,14 +331,16 @@ class _AppointmentActionsState extends State { Future> _getConfirmedCheckInAppoActionsList() async { print("_getConfirmedAllowCheckInAppoActionsList"); - print(ConfirmedButtonsAllowCheckIn.buttons); + ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn = + new ConfirmedButtonsAllowCheckIn(); + print(confirmedButtonsAllowCheckIn.buttons); List buttonsList = []; - for (var i = 0; i < ConfirmedButtonsAllowCheckIn.buttons.length; i++) { + for (var i = 0; i < confirmedButtonsAllowCheckIn.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ConfirmedButtonsAllowCheckIn.buttons[i]['title'], - subtitle: ConfirmedButtonsAllowCheckIn.buttons[i]['subtitle'], - icon: ConfirmedButtonsAllowCheckIn.buttons[i]['icon'], - caller: ConfirmedButtonsAllowCheckIn.buttons[i]['caller'], + title: confirmedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: confirmedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: confirmedButtonsAllowCheckIn.buttons[i]['icon'], + caller: confirmedButtonsAllowCheckIn.buttons[i]['caller'], )); } setState(() { @@ -344,14 +350,15 @@ class _AppointmentActionsState extends State { Future> _getArrivedAppoActionsList() async { print("_getArrivedAppoActionsList"); - print(ArrivedButtons.buttons); + ArrivedButtons arrivedButtons = new ArrivedButtons(); + print(arrivedButtons.buttons); List buttonsList = []; - for (var i = 0; i < ArrivedButtons.buttons.length; i++) { + for (var i = 0; i < arrivedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ArrivedButtons.buttons[i]['title'], - subtitle: ArrivedButtons.buttons[i]['subtitle'], - icon: ArrivedButtons.buttons[i]['icon'], - caller: ArrivedButtons.buttons[i]['caller'], + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], )); } setState(() { @@ -361,14 +368,14 @@ class _AppointmentActionsState extends State { Future> _getArrivedInvoiceAppoActionsList() async { print("_getArrivedInvoiceAppoActionsList"); - print(ArrivedButtons.buttons); + ArrivedButtons arrivedButtons = new ArrivedButtons(); List buttonsList = []; - for (var i = 0; i < ArrivedButtons.buttons.length; i++) { + for (var i = 0; i < arrivedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ArrivedButtons.buttons[i]['title'], - subtitle: ArrivedButtons.buttons[i]['subtitle'], - icon: ArrivedButtons.buttons[i]['icon'], - caller: ArrivedButtons.buttons[i]['caller'], + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], )); } setState(() { @@ -474,7 +481,8 @@ class _AppointmentActionsState extends State { prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); }); print(prescriptionReportEnhList.length); - navigateToMedicinePrescriptionReport(prescriptionReportEnhList, res['ListPRM']); + navigateToMedicinePrescriptionReport( + prescriptionReportEnhList, res['ListPRM']); } else { AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } diff --git a/pubspec.yaml b/pubspec.yaml index d65a4f8e..7a31f862 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -146,7 +146,7 @@ dependencies: google_maps_place_picker: ^1.0.0 #countdown timer for Upcoming List - flutter_countdown_timer: ^1.4.0 + flutter_countdown_timer: ^1.6.0 #Dependencies for video call implementation native_device_orientation: ^0.3.0