diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index caada21f..703f5e3c 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -29,3 +29,5 @@ const BLOOD_TYPE = 'blood-type'; const NOTIFICATION_COUNT = 'notification-count'; const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; +const H2O_UNIT = 'H2O_UNIT'; +const H2O_REMINDER = 'H2O_REMINDER'; diff --git a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart index 5f41f878..26bf567a 100644 --- a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart +++ b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart @@ -1,4 +1,4 @@ -class ReauestInsuranceApprovalModel { +class RequestInsuranceApprovalModel { double versionID; int channel; int languageID; @@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel { int eXuldAPPNO; int projectID; - ReauestInsuranceApprovalModel( + RequestInsuranceApprovalModel( {this.versionID, this.channel, this.languageID, @@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel { this.eXuldAPPNO, this.projectID}); - ReauestInsuranceApprovalModel.fromJson(Map json) { + RequestInsuranceApprovalModel.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/prescriptions/request_send_prescription_email.dart b/lib/core/model/prescriptions/request_send_prescription_email.dart index 2d1f3aa3..ecd0f36d 100644 --- a/lib/core/model/prescriptions/request_send_prescription_email.dart +++ b/lib/core/model/prescriptions/request_send_prescription_email.dart @@ -23,6 +23,7 @@ class RequestSendPrescriptionEmail { String setupID; String clinicName; String doctorName; + int doctorID; int projectID; List listPrescriptions; @@ -49,7 +50,8 @@ class RequestSendPrescriptionEmail { this.setupID, this.clinicName, this.doctorName, - this.projectID}); + this.projectID, + this.doctorID}); RequestSendPrescriptionEmail.fromJson(Map json) { appointmentDate = json['AppointmentDate']; @@ -75,6 +77,7 @@ class RequestSendPrescriptionEmail { clinicName = json['ClinicName']; doctorName = json['DoctorName']; projectID = json['ProjectID']; + doctorID = json['DoctorID']; } Map toJson() { @@ -106,7 +109,7 @@ class RequestSendPrescriptionEmail { data['ClinicName'] = this.clinicName; data['DoctorName'] = this.doctorName; data['ProjectID'] = this.projectID; - + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart new file mode 100644 index 00000000..a0ce7d07 --- /dev/null +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -0,0 +1,48 @@ + +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +import '../base_view_model.dart'; + + +class RRTService extends BaseService{ + +} + + +class RRTViewModel extends BaseViewModel{ + var _service = RRTService(); + + Future createRequest(){ + + return null; + } + + + Future getAllRequest(){ + + return null; + } + + + Future getRequestDetails(){ + + return null; + } + + + Future getAllQuestions(){ + + return null; + } + + + Future getCancelReasons(){ + + return null; + } + + Future cancelRequest(){ + + return null; + } +} \ No newline at end of file diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart index adb7223e..15ac9219 100644 --- a/lib/core/viewModels/medical/reports_monthly_view_model.dart +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -14,6 +14,10 @@ class ReportsMonthlyViewModel extends BaseViewModel { ReportsService _reportsService = locator(); String get userAgreementContent => _reportsService.userAgreementContent; + bool get receiveHealthSummaryReport => _reportsService?.user?.receiveHealthSummaryReport ?? false; + set receiveHealthSummaryReport(bool val) { + _reportsService?.user?.receiveHealthSummaryReport = val; + } getUserTermsAndConditions() async { setState(ViewState.Busy); @@ -26,14 +30,9 @@ class ReportsMonthlyViewModel extends BaseViewModel { } } - updatePatientHealthSummaryReport( - {String message, - bool isSummary, - bool isUpdateEmail = false, - String email}) async { + updatePatientHealthSummaryReport({String message, bool isSummary, bool isUpdateEmail = false, String email}) async { setState(ViewState.BusyLocal); - await _reportsService.updatePatientHealthSummaryReport( - isSummary: isSummary); + await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); if (_reportsService.hasError) { error = _reportsService.error; AppToast.showErrorToast(message: error); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart index a541b3ce..9b0ee417 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -50,9 +50,9 @@ class ResultPage extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( + isShowDecPage: false, isShowAppBar: true, - appBarTitle: - "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", + appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", body: Column( children: [ Expanded( @@ -112,11 +112,10 @@ class ResultPage extends StatelessWidget { backgroundColor: Theme.of(context).primaryColor, radius: 8, fontWeight: FontWeight.bold, - handler: (){ + handler: () { Navigator.push( context, - FadePage( - page: BariatricsPage(1, 1, finalResult)), + FadePage(page: BariatricsPage(1, 1, finalResult)), ); }, ), diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 00fb2fc8..ff7224be 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -13,8 +13,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:nfc_in_flutter/nfc_in_flutter.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -30,17 +32,27 @@ class QRCode extends StatefulWidget { class _QRCodeState extends State { Uint8List _bytes; + bool _supportsNFC = false; + BuildContext _context; @override void initState() { // TODO: implement initState + _bytes = base64.decode(widget.appoQR.split(',').last); widget.authUser = new AuthenticatedUser(); + NFC.isNDEFSupported.then((supported) { + setState(() { + print("nfc supprted"); + _supportsNFC = true; + }); + }); super.initState(); } @override Widget build(BuildContext context) { + _context = context; return AppScaffold( appBarTitle: TranslationBase.of(context).attendRegisterCode, isShowAppBar: true, @@ -51,9 +63,56 @@ class _QRCodeState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - child: Image.memory(_bytes, scale: 0.5), + width: double.infinity, + height: MediaQuery.of(context).size.width / 3, + child: Row( + children: [ + _supportsNFC + ? Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + child: Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10), + ), + child: Image.asset( + "assets/images/nfc/ic_nfc.png"), + ), + onTap: () { + showNfcReader(context, + onNcfScan: (String nfcId) { + Future.delayed( + const Duration(milliseconds: 100), + () { + sendNfcCheckInRequest(nfcId); + }); + }); + }, + ), + ], + ), + ) + : Container(), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + child: Image.memory( + _bytes, + ), + ), + ), + ], + ), ), Container( margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), @@ -70,18 +129,20 @@ class _QRCodeState extends State { EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), child: Image.asset( "assets/images/new-design/device_icon.png", - width: 120.0, - height: 120.0), + width: MediaQuery.of(context).size.width / 3.4, + height: MediaQuery.of(context).size.width / 3.4), ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, - style: TextStyle( - color: Colors.red[700], - fontSize: 20.0, - fontWeight: FontWeight.bold)), + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + color: Colors.red[700], + fontSize: 18.0, + fontWeight: FontWeight.bold)), + ), ), ], ), @@ -300,4 +361,51 @@ class _QRCodeState extends State { } return docSpeciality; } + + sendNfcCheckInRequest(String nfcId) { + GifLoaderDialogUtils.showMyDialog(context); + + DoctorsListService service = new DoctorsListService(); + + service + .sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, + widget.patientShareResponse.projectID, context) + .then((res) { + print(res); + + GifLoaderDialogUtils.hideDialog(context); + _showMyDialog(res["SuccessMsg"], this.context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + _showMyDialog(err, this.context); + }); + } + + Future _showMyDialog(String message, BuildContext context) async { + return showDialog( + context: context, + barrierDismissible: true, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Alert'), + content: SingleChildScrollView( + child: ListBody( + children: [ + Text(message), + ], + ), + ), + actions: [ + TextButton( + child: const Text('OK'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } } diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index a1ecb7a0..5b4f6dc3 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -93,6 +93,7 @@ class _SearchByDoctorState extends State { service .getDoctorsListByName(doctorNameController.text, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { @@ -129,9 +130,12 @@ class _SearchByDoctorState extends State { navigateToSearchResults( context, doctorsList, _patientDoctorAppointmentListHospital); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 63d915d1..6f3281dc 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -206,7 +206,7 @@ class _SelectTransportationMethodState SizedBox( height: 8, ), - Texts(TranslationBase.of(context).directionHeading), + Texts(TranslationBase.of(context).wayHeading), SizedBox( height: 5, ), diff --git a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart new file mode 100644 index 00000000..acfe13d8 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -0,0 +1,94 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class RRTLogPage extends StatefulWidget{ + + @override + State createState() => RRTLogPageState(); + +} +class RRTLogPageState extends State{ + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget){ + return ListView.builder( + itemCount: 10, + itemBuilder: (ctx, idx) => RRTLogListItem() + ); + } + ); + } + +} + + + +// ------------------------ +// List Item Widget +// ------------------------ + + +final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); + +class RRTLogListItem extends StatelessWidget{ + BuildContext _context; + @override + Widget build(BuildContext context) { + _context = context; + + return Container( + padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _contentItem(label: "Request ID", value: "2318"), + _item_content_seperator, + _contentItem(label: "Status", value: "2318"), + _item_content_seperator, + _contentItem(label: "Pickup Date", value: "2318"), + _item_content_seperator, + _contentItem(label: "Location", value: "2318"), + _item_content_seperator, + SizedBox(height: 10), + FractionallySizedBox(child: cancelButton()) + ], + ), + ); + } + + Widget _contentItem({@required String label, String value}){ + return Container( + padding: EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),), + SizedBox(height: 5,), + Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),), + ], + ), + ); + } + + Widget cancelButton() => MaterialButton( + height: 45, + color: Color(0xFFc5272d), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text("CANCEL", style: TextStyle(color: Colors.white, fontSize: 13),), + + ); +} + diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart new file mode 100644 index 00000000..fe1c6a9d --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -0,0 +1,77 @@ + +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTMainScreen extends StatefulWidget{ + @override + State createState() => RRTMainScreenState(); +} + +class RRTMainScreenState extends State with SingleTickerProviderStateMixin{ + + int currentIndex = 0; + TabController tabController; + PageController pageController = PageController(initialPage: 0, keepPage: true); + + @override + void initState() { + super.initState(); + tabController = TabController(length: 2, vsync: this); + } + + @override + Widget build(BuildContext context) { + + return AppScaffold( + appBarTitle: 'Rapid Response Team', + isShowAppBar: true, + body: Column( + children: [ + tabBar(), + Expanded( + child: contentPager() + ) + ], + ), + ); + } + + Widget tabBar() => Container( + margin: EdgeInsets.all(15), + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), + child: TabBar( + onTap: onPageChanged, + indicatorWeight: 3, + indicatorColor: Color(0xFFc5272d), + isScrollable: false, + controller: tabController, + indicatorSize: TabBarIndicatorSize.label, + tabs: [ + Tab( + child: Text("Rapid Response Team", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + ), + Tab( + child: Text("Order Log", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + ), + ] + ), + ); + + Widget contentPager() => PageView( + onPageChanged: onPageChanged, + controller: pageController, + children: [ + RRTRequestPage(), + RRTLogPage(), + ], + ); + + void onPageChanged(int index) { + pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); + tabController.animateTo(index); + } +} 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 new file mode 100644 index 00000000..91e9cbd2 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -0,0 +1,92 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class RRTRequestPickupAddressPage extends StatefulWidget{ + + @override + State createState() => RRTRequestPickupAddressPageState(); + +} +class RRTRequestPickupAddressPageState extends State{ + bool acceptTerms = false; + Completer mapController = Completer(); + + static final CameraPosition mapCamera = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget) => AppScaffold( + appBarTitle: TranslationBase.of(context).pickupLocation, + isShowAppBar: true, + body: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + selectAddress(), + Expanded( + child: GoogleMap( + mapType: MapType.normal, + initialCameraPosition: mapCamera, + onCameraIdle: (){ + + }, + onMapCreated: (controller){ + mapController.complete(controller); + }, + ) + ), + continueButton() + ], + ) + ) + ); + } + + Widget selectAddress(){ + return Container( + margin: EdgeInsets.all(15), + child: Expanded( + child: MaterialButton( + height: 50, + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Row( + children: [ + Text(TranslationBase.of(context).selectAddress, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + Spacer(), + Icon(Icons.keyboard_arrow_down, size: 15, color: Colors.grey,) + ], + ), + ), + ), + ); + } + + Widget continueButton(){ + return Padding( + padding: const EdgeInsets.all(15), + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text(TranslationBase.of(context).continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), + ), + ); + } + +} \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart new file mode 100644 index 00000000..9fb0a2f5 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -0,0 +1,176 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTRequestPage extends StatefulWidget{ + + @override + State createState() => RRTRequestPageState(); + +} +class RRTRequestPageState extends State{ + bool acceptTerms = false; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget) => Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + children: [ + serviceDescription(context), + SizedBox(height: 20), + priceTable(context), + + acceptPolicy(), + + Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator + + Container( + padding: EdgeInsets.only(top: 20, bottom: 5), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) + ), + + paymentOptions(), + ], + ), + ), + + actionButtons() + ], + ) + ); + } + + Widget serviceDescription(BuildContext context) => + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + TranslationBase.of(context).RRTDDetails, + textAlign: TextAlign.justify, + style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), + ), + ); + + Widget priceTable(BuildContext context){ + var radius = Radius.circular(8); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + height: 30, + decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), + child: Center(child: Text(TranslationBase.of(context).ApproximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + ), + + pricingRow(label: TranslationBase.of(context).AmountBeforeTax, value: '500 SAR'), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + + pricingRow(label: TranslationBase.of(context).TaxAmount, value: '50 SAR'), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + + pricingRow(label: TranslationBase.of(context).TotalAmountPayable, value: '550 SAR', labelBold: true), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + ], + ); + } + + Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}){ + return + Container( + height: 40, margin: EdgeInsets.symmetric(horizontal: 10), + child: Row( + children: [ + Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)), + Spacer(), + Container(height: 40, color: Theme.of(context).appBarTheme.color, width: 0.5,), + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width * 0.25, + child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal)) + ), + ], + ), + ); + } + + + Widget acceptPolicy(){ + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Row( + children: [ + Checkbox(value: acceptTerms, onChanged: (v){ + setState(() => acceptTerms = v); + }), + SizedBox(width: 10), + Expanded( + child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2) + ), + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width * 0.25, + child: TextButton( + child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)), + onPressed: (){ + + } + ), + ) + ], + ), + ); + } + + Widget paymentOptions()=> Container( + height: 30, + alignment: Alignment.center, + child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,) + ); + + Widget actionButtons(){ + return Container( + margin: EdgeInsets.all(15), + child: Row( + children: [ + Expanded( + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text(TranslationBase.of(context).cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + + ), + ), + SizedBox(width: 20,), + Expanded( + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + child: Text(TranslationBase.of(context).ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + onPressed: () { + Navigator.push( + context, + FadePage( + page: RRTRequestPickupAddressPage())); + }, + ), + ) + ], + ), + ); + } + +} \ No newline at end of file diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index fca9624c..a8e553be 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart' import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'dart:convert'; import 'dart:io'; @@ -326,9 +327,9 @@ class _SendFeedbackPageState extends State { fontSize: 13.5, hintColor: Colors.black, fontWeight: FontWeight.w600, - onChanged: (v){setState(() { - - });}, + onChanged: (v) { + setState(() {}); + }, validator: (value) { if (value.isEmpty) return TranslationBase.of(context).emptySubject; @@ -349,11 +350,13 @@ class _SendFeedbackPageState extends State { controller: messageController, suffixIcon: Icons.mic, onSuffixTap: () { + requestPermissions(); + openSpeechReco(); }, - onChanged: (v){setState(() { - - });}, + onChanged: (v) { + setState(() {}); + }, validator: (value) { if (value.isEmpty) return TranslationBase.of(context).emptyMessage; @@ -437,7 +440,7 @@ class _SendFeedbackPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, + height: 80, width: double.infinity, padding: EdgeInsets.all(15.0), child: Center( @@ -447,39 +450,37 @@ class _SendFeedbackPageState extends State { label: TranslationBase.of(context).send, textColor: Colors.white, disabled: (titleController.text.toString().isEmpty || - messageController.text.toString().isEmpty ), + messageController.text.toString().isEmpty), onTap: () { final form = formKey.currentState; if (form.validate()) { - - GifLoaderDialogUtils.showMyDialog(context); - model - .sendCOCItem( - title: titleController.text, - attachment: images.length > 0 ? images[0] : "", - details: messageController.text, - cOCTypeName: getCOCName(), - appointHistory: messageType == - MessageType.ComplaintOnAnAppointment - ? appointHistory - : null) - .then((value) { - if (value) { - setState(() { - titleController.text = ""; - messageController.text = ""; - images = []; - }); - setMessageType(MessageType.NON); - GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: TranslationBase.of(context).yourFeedback); - } else { - AppToast.showErrorToast(message: model.error); - GifLoaderDialogUtils.hideDialog(context); - } - }); - + GifLoaderDialogUtils.showMyDialog(context); + model + .sendCOCItem( + title: titleController.text, + attachment: images.length > 0 ? images[0] : "", + details: messageController.text, + cOCTypeName: getCOCName(), + appointHistory: messageType == + MessageType.ComplaintOnAnAppointment + ? appointHistory + : null) + .then((value) { + if (value) { + setState(() { + titleController.text = ""; + messageController.text = ""; + images = []; + }); + setMessageType(MessageType.NON); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast( + message: TranslationBase.of(context).yourFeedback); + } else { + AppToast.showErrorToast(message: model.error); + GifLoaderDialogUtils.hideDialog(context); + } + }); } }, ), @@ -544,7 +545,7 @@ class _SendFeedbackPageState extends State { if (available) { speech.listen( onResult: resultListener, - // listenMode: ListenMode.confirmation, + listenMode: stt.ListenMode.confirmation, localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', ); } else { @@ -552,12 +553,23 @@ class _SendFeedbackPageState extends State { } } - void errorListener(SpeechRecognitionError error) {} + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; } + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + print(statuses); + } + void resultListener(result) { reconizedWord = result.recognizedWords; event.setValue({"searchText": reconizedWord}); @@ -565,10 +577,18 @@ class _SendFeedbackPageState extends State { if (result.finalResult == true) { setState(() { RoboSearch.closeAlertDialog(context); - messageController.text = reconizedWord; + speech.stop(); + messageController.text = reconizedWord + '\n'; }); } } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } } class FeedbackTypeDialog extends StatefulWidget { @@ -588,7 +608,6 @@ class FeedbackTypeDialogState extends State { setMessageDialogType(MessageType messageType) { setState(() { - messageTypeDialog = messageType; }); } diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 467068cc..d28fea86 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -278,44 +278,46 @@ class _RegisterInfo extends State { registerNow() { dynamic request = getTempUserRequest(); GifLoaderDialogUtils.showMyDialog(context); - this.authService.registerUser(request).then((result) => { - GifLoaderDialogUtils.hideDialog(context), - // userData = result.list; - //AuthenticatedUser.fromJson(result['List'][0]), - if(result is String){ - new ConfirmDialog( - context: context, - confirmMessage: result, - okText: TranslationBase.of(context).ok, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => { - ConfirmDialog.closeAlertDialog(context) - }, - cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}) - .showAlertDialog(context) - - }else - { - result.list.isFamily = false, - sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - Navigator.of(context).pushNamed(HOME) - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); + this + .authService + .registerUser(request) + .then((result) => { + GifLoaderDialogUtils.hideDialog(context), + // userData = result.list; + //AuthenticatedUser.fromJson(result['List'][0]), + if (result is String) + { + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => + {ConfirmDialog.closeAlertDialog(context)}, + cancelFunction: () => { + ConfirmDialog.closeAlertDialog(context) + }).showAlertDialog(context) + } + else + { + result.list.isFamily = false, + sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + Navigator.of(context).pushNamed(HOME) + } + }) + .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => { - ConfirmDialog.closeAlertDialog(context) - }, + okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - }); } @@ -347,17 +349,18 @@ class _RegisterInfo extends State { "PatientIdentificationNo": registerInfo.idNumber, "MobileNumber": registerd_data.patientMobileNumber, "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, - "FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr, - "FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn, - "MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr, - "MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn, - "LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr, - "LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn, + "FirstNameN": registerInfo.firstNameAr, + "FirstName": registerInfo.firstNameEn, + "MiddleNameN": registerInfo.secondNameAr, + "MiddleName": registerInfo.secondNameEn, + "LastNameN": registerInfo.lastNameAr, + "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, "DateofBirth": DateUtil.convertISODateToJsonDate( registerInfo.dateOfBirth.replaceAll('/', '-')), "Gender": registerInfo.gender == 'M' ? 1 : 2, - "NationalityID": registerInfo.nationality, + "NationalityID": registerInfo.nationalityCode, + "eHealthIDField": registerInfo.healthId, "DateofBirthN": date, "EmailAddress": email, "SourceType": location, diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index c6a3b872..1591d1d5 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; class Register extends StatefulWidget { @override @@ -294,12 +295,12 @@ class _Register extends State { // DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'), // IsHijri: Number(this.dateOption) // } + + final DateFormat dateFormat = DateFormat('dd/MM/yyyy'); GifLoaderDialogUtils.showMyDialog(context); var request = CheckUserStatusRequest(); request.patientIdentificationID = nationalIDorFile.text; - request.dOB = isHijri == 1 - ? dob - : "${selectedDate.toLocal()}".split(' ')[0].replaceAll('-', '/'); + request.dOB = isHijri == 1 ? dob : dateFormat.format(selectedDate); request.isHijri = isHijri; request.patientOutSA = countryCode == '966' ? 0 : 1; this.authService.checkUserStatus(request).then((result) => { @@ -311,7 +312,12 @@ class _Register extends State { Navigator.of(context).push(FadePage(page: ConfirmLogin())), } else - {AppToast.showErrorToast(message: result)} + { + AppToast.showErrorToast( + message: result + ? result + : TranslationBase.of(context).somethingWentWrong) + } }); } diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 55e04a73..eaf2913d 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -104,7 +104,8 @@ class _RequestTypePageState extends State { ), bottomSheet: Container( width: double.maxFinite, - height: MediaQuery.of(context).size.height * 0.1, + // height: MediaQuery.of(context).size.height * 0.1, + height: 80.0, child: Padding( padding: const EdgeInsets.all(12.0), child: SecondaryButton( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 72d0422b..922fb239 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -61,15 +61,13 @@ class ReportListWidget extends StatelessWidget { ), Texts(reportList[index].projectName), Texts(reportList[index].clinicDescription), - Texts(TranslationBase.of(context).invoiceNo + - ': ${reportList[index].invoiceNo}'), + Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), SizedBox(height: 12), ], ), reportList[index].status == 2 ? Container( - margin: - EdgeInsets.only(left: 15.0, right: 15.0), + margin: EdgeInsets.only(left: 15.0, right: 15.0), child: InkWell( onTap: () { showConfirmMessage(reportList[index]); @@ -78,7 +76,7 @@ class ReportListWidget extends StatelessWidget { child: Icon( Icons.email, color: Theme.of(context).primaryColor, - size: 35.0, + size: 30.0, ), ), ) @@ -123,8 +121,7 @@ class ReportListWidget extends StatelessWidget { report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showSuccessToast( - message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(err); diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index bf0f4b4e..7fe38f1b 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -94,6 +94,11 @@ class _RateAppointmentClinicState extends State { height: 8, ), LargeAvatar( + url: + 'https://hmgwebservices.com/Images/Hospitals/' + + model.appointmentDetails.projectID + .toString() + + '.jpg', name: model.appointmentDetails.clinicName, width: 110, height: 110, @@ -146,19 +151,17 @@ class _RateAppointmentClinicState extends State { child: Container( key: ValueKey(rating), child: IconButton( - iconSize: 45.0, + //iconSize: 45.0, onPressed: () { setState(() { rating = index + 1; }); }, - color: rating >= (index + 1) - ? Color.fromRGBO(255, 186, 0, 1.0) - : Colors.grey[400], + iconSize: rating == (index + 1) ? 60 : 40, // Theme.of(context).hintColor, - icon: Icon(rating >= (index + 1) - ? EvaIcons.star - : EvaIcons.star)), + icon: Image.asset('assets/images/' + + (index + 1).toString() + + '.png')), ), ), ) @@ -208,8 +211,8 @@ class _RateAppointmentClinicState extends State { } }, label: TranslationBase.of(context).submit, - disabled: (model.state == ViewState.Busy || rating==0), - // loading: model.state == ViewState.BusyLocal, + disabled: (model.state == ViewState.Busy || rating == 0), + // loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), ), SizedBox( @@ -225,7 +228,7 @@ class _RateAppointmentClinicState extends State { ); }, child: Texts( - TranslationBase.of(context).later, + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 833cdf2b..d877514c 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -44,7 +44,7 @@ class _ProfileSettings extends State child: model.user != null ? ListView(scrollDirection: Axis.vertical, children: [ Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.all(15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -74,7 +74,7 @@ class _ProfileSettings extends State padding: EdgeInsets.all(10), ), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Row( @@ -93,7 +93,7 @@ class _ProfileSettings extends State ], )), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Row( @@ -116,7 +116,7 @@ class _ProfileSettings extends State padding: EdgeInsets.all(10), ), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Row( @@ -136,7 +136,7 @@ class _ProfileSettings extends State ], )), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Row( @@ -160,7 +160,7 @@ class _ProfileSettings extends State padding: EdgeInsets.all(10), ), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Column( @@ -175,7 +175,7 @@ class _ProfileSettings extends State ], )), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Column( @@ -190,7 +190,7 @@ class _ProfileSettings extends State ], )), Container( - color: Theme.of(context).primaryColor, + color: Theme.of(context).textTheme.headline2.color, padding: EdgeInsets.only( top: 0, left: 10, right: 10, bottom: 0), child: Column( diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index b5a4655a..8c4ba851 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -241,7 +241,7 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 15.0, + fontSize: widget.small ? 12.0 : 14.0, // fontWeight: FontWeight.w800, fontFamily: projectViewModel.isArabic ? 'Cairo'