diff --git a/lib/core/model/prescriptions/perscription_pharmacy.dart b/lib/core/model/prescriptions/perscription_pharmacy.dart index 3adaef7e..9c9bec08 100644 --- a/lib/core/model/prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/prescriptions/perscription_pharmacy.dart @@ -7,7 +7,7 @@ class PharmacyPrescriptions { int projectID; String setupID; String locationDescription; - Null locationDescriptionN; + dynamic locationDescriptionN; String itemDescription; Null itemDescriptionN; String alias; @@ -16,7 +16,7 @@ class PharmacyPrescriptions { Null companybarcode; int cityID; String cityName; - int distanceInKilometers; + dynamic distanceInKilometers; String latitude; int locationType; String longitude; diff --git a/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..4b099f5b 100644 --- a/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,6 +1,6 @@ class RequestGetListPharmacyForPrescriptions { - int latitude; - int longitude; + dynamic latitude; + dynamic longitude; double versionID; int channel; int languageID; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index cdd355c3..ce91be53 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; @@ -119,6 +120,13 @@ class PrescriptionsService extends BaseService { Future getListPharmacyForPrescriptions({int itemId}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; + + requestGetListPharmacyForPrescriptions.latitude = await sharedPref.getDouble(USER_LAT); + requestGetListPharmacyForPrescriptions.longitude = await sharedPref.getDouble(USER_LONG); + + // requestGetListPharmacyForPrescriptions.latitude = 24.709863; + // requestGetListPharmacyForPrescriptions.longitude = 46.668348; + pharmacyPrescriptionsList.clear(); await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 1ae738cf..f03629d4 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -99,7 +99,7 @@ class DoctorView extends StatelessWidget { filledIcon: Icons.star, emptyIcon: Icons.star_border, ), - Icon( + if (isShowFlag) Icon( Icons.arrow_forward, color: Theme.of(context).primaryColor, ), diff --git a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart index cdc7be72..c88283be 100644 --- a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -53,9 +54,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts(prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN ?? ''), + child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''), ), ), ) @@ -68,70 +67,172 @@ class PharmacyForPrescriptionsPage extends StatelessWidget { scrollDirection: Axis.vertical, physics: BouncingScrollPhysics(), itemBuilder: (context, index) => Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), + margin: EdgeInsets.all(12.0), + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.pharmacyPrescriptionsList[index].projectImageURL, - fit: BoxFit.cover, - width: 60, - height: 70, + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => AssetGiffyDialog( + title: Text( + model.pharmacyPrescriptionsList[index].locationDescription, + style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600), + ), + image: Image.network( + model.pharmacyPrescriptionsList[index].projectImageURL.toString(), + fit: BoxFit.cover, + ), + buttonCancelText: Text(TranslationBase.of(context).cancel), + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + ), + ); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Image.network( + model.pharmacyPrescriptionsList[index].projectImageURL.toString(), + width: 48, + height: 48, + fit: BoxFit.cover, + ), ), ), Expanded( child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.pharmacyPrescriptionsList[index].locationDescription), - SizedBox( - height: 5, - ), - Texts(model.pharmacyPrescriptionsList[index].cityName), - ], + padding: EdgeInsets.only(left: 12, right: 12), + child: Text( + model.pharmacyPrescriptionsList[index].locationDescription?.trim().toString() + + "\n" + + model.pharmacyPrescriptionsList[index].cityName.trim().toString() + + "\n" + + model.pharmacyPrescriptionsList[index].distanceInKilometers.toString() + + " " + + TranslationBase.of(context).km_ ?? + "", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), ), ), - ), - InkWell( - onTap: () { - MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude)); - }, - child: Icon( - Icons.pin_drop, - size: 18, - color: Colors.red[900], + ), //model.cOCItemList[index].cOCTitl + IconButton( + icon: Icon( + Icons.location_on, + color: Color(0xff2B353E), ), + constraints: BoxConstraints(), + padding: EdgeInsets.all(8), + tooltip: '', + onPressed: () { + // setState(() { + MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude), + model.pharmacyPrescriptionsList[index].locationDescription); + // }); + }, ), - SizedBox( - width: 15, - ), - InkWell( - onTap: Feedback.wrapForTap(() { - launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}"); - }, context), - child: Container( - child: Icon( - Icons.call, - size: 18, - color: Colors.red[900], - ), + IconButton( + icon: Icon( + Icons.phone, + color: Color(0xff2B353E), ), - ) + constraints: BoxConstraints(), + padding: EdgeInsets.all(8), + tooltip: '', + onPressed: () { + // setState(() { + launch("tel://" + model.pharmacyPrescriptionsList[index].phoneNumber); + // }); + }, + ), ], ), ), + // Container( + // width: double.infinity, + // margin: EdgeInsets.only(top: 10, left: 10, right: 10), + // padding: EdgeInsets.all(8.0), + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.all( + // Radius.circular(10.0), + // ), + // border: Border.all(color: Colors.grey[200], width: 0.5), + // ), + // child: Row( + // children: [ + // ClipRRect( + // borderRadius: BorderRadius.all(Radius.circular(5)), + // child: Image.network( + // model.pharmacyPrescriptionsList[index].projectImageURL, + // fit: BoxFit.cover, + // width: 60, + // height: 70, + // ), + // ), + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts(model.pharmacyPrescriptionsList[index].locationDescription), + // SizedBox( + // height: 5, + // ), + // Texts(model.pharmacyPrescriptionsList[index].cityName), + // ], + // ), + // ), + // ), + // InkWell( + // onTap: () { + // MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude)); + // }, + // child: Icon( + // Icons.pin_drop, + // size: 18, + // color: Colors.red[900], + // ), + // ), + // SizedBox( + // width: 15, + // ), + // InkWell( + // onTap: Feedback.wrapForTap(() { + // launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}"); + // }, context), + // child: Container( + // child: Icon( + // Icons.call, + // size: 18, + // color: Colors.red[900], + // ), + // ), + // ) + // ], + // ), + // ), itemCount: model.pharmacyPrescriptionsList.length, ), )