diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f8001fae..608c67f0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1495,4 +1495,6 @@ const Map localizedValues = { "noSlotsError": {"en": "No appointments available for selected date", "ar": "لا توجد مواعيد متاحة للتاريخ المحدد"}, "selectSlot": {"en": "Please select Time Slot to continue", "ar": "الرجاء تحديد فترة زمنية للمتابعة"}, "years": {"en": "Years", "ar": "سنوات"}, + "respirationBPM": { "en": "bpm", "ar": "نفس" }, + "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, }; diff --git a/lib/core/model/er/PatientER_RC.dart b/lib/core/model/er/PatientER_RC.dart index f5afc1d6..ec564128 100644 --- a/lib/core/model/er/PatientER_RC.dart +++ b/lib/core/model/er/PatientER_RC.dart @@ -103,6 +103,7 @@ class TransportationDetails { String pickupDateTime; String transportationType; int ambulate; + String ambulateTitle; String notes; int requesterFileNo; String requesterMobileNo; @@ -128,6 +129,7 @@ class TransportationDetails { this.pickupDateTime, this.transportationType, this.ambulate, + this.ambulateTitle, this.notes, this.requesterFileNo, this.requesterMobileNo, @@ -153,6 +155,7 @@ class TransportationDetails { pickupDateTime = json['pickupDateTime']; transportationType = json['transportationType']; ambulate = json['ambulate']; + ambulateTitle = ""; notes = json['notes']; requesterFileNo = json['requesterFileNo']; requesterMobileNo = json['requesterMobileNo']; @@ -180,6 +183,7 @@ class TransportationDetails { data['pickupDateTime'] = this.pickupDateTime; data['transportationType'] = this.transportationType; data['ambulate'] = this.ambulate; + data['ambulateTitle'] = this.ambulateTitle; data['notes'] = this.notes; data['requesterFileNo'] = this.requesterFileNo; data['requesterMobileNo'] = this.requesterMobileNo; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index d6da1ee3..57bb9c51 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -86,6 +86,7 @@ class FeedbackService extends BaseService { response['ListCOCItems'].forEach((cOC) { cOCItemList.add(COCItem.fromJson(cOC)); }); + cOCItemList = cOCItemList.reversed.toList(); // Sort list in desc order }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart b/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart index 0b6d7a1d..424a4b20 100644 --- a/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart +++ b/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart @@ -21,14 +21,15 @@ class PrescriptionDeliveryViewModel extends BaseViewModel { setState(ViewState.Busy); await _pharmacyModuleService.generatePharmacyToken().then((value) async { // await _customerAddressesService.getCustomerInfo(); - await _customerAddressesService.getCustomerInfo(); + // await _customerAddressesService.getCustomerInfo(); + await _pharmacyModuleService.createUser(); }); if (_customerAddressesService.hasError) { error = _customerAddressesService.error; setState(ViewState.ErrorLocal); } else { - await getCustomerAddresses(); } + await getCustomerAddresses(); } Future insertDeliveryOrder( diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 7ce9e2b7..07d17db4 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -164,11 +164,11 @@ class _SearchByDoctorState extends State { getDoctorsList(context); } - Future navigateToSearchResults( + navigateToSearchResults( context, List docList, List - patientDoctorAppointmentListHospital) async { + patientDoctorAppointmentListHospital) { Navigator.push( context, FadePage( diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index fb9c0b0b..6070ab51 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -1,7 +1,4 @@ -import 'dart:ui'; - import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; -import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -49,40 +46,7 @@ class _LiveChatPageState extends State with SingleTickerProviderSt showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: CustomColors.appBackgroudGrey2Color, - body: Column( - children: [ - TabBar( - controller: _tabController, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - tabs: [Text(TranslationBase.of(context).hospitals), Text(TranslationBase.of(context).pharmacies)], - ), - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - HospitalsLiveChatPage(), //SendFeedbackPage(), - PharmaciesLiveChatPage() - //StatusFeedbackPage() - ], - ), - ) - ], - ), + body: HospitalsLiveChatPage(), ); } -} +} \ No newline at end of file diff --git a/lib/pages/DrawerPages/family/add-family-member.dart b/lib/pages/DrawerPages/family/add-family-member.dart index 75291ee2..320ca8d1 100644 --- a/lib/pages/DrawerPages/family/add-family-member.dart +++ b/lib/pages/DrawerPages/family/add-family-member.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_re import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -12,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; -import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; @@ -41,6 +41,7 @@ class _AddMember extends State { var familyFileProvider = FamilyFilesProvider(); var patientShareRequestID; + @override void initState() { super.initState(); @@ -101,7 +102,7 @@ class _AddMember extends State { child: DefaultButton( TranslationBase.of(context).add, () => {this.addMember()}, - color: isButtonDisabled == true ? Colors.grey : Colors.red[600], + color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor, textColor: Colors.white, )) ], @@ -139,7 +140,7 @@ class _AddMember extends State { request.isRegister = false; request.patientStatus = 2; loading(true); - familyFileProvider.addFamilyFile(request).then((value) => manageFamily(value)).catchError(() { + familyFileProvider.addFamilyFile(request).then((value) => manageFamily(value)).catchError((err) { loading(false); }); } @@ -183,6 +184,7 @@ class _AddMember extends State { } var tempType; + startSMSService(type, result) { tempType = type; loading(false); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 1d0478d1..d78dccf7 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -519,7 +519,7 @@ class _MyFamily extends State with TickerProviderStateMixin { // Utils.showProgressDialog(context); this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { print(err); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); }); } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index cf290e5e..939c138c 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -2,12 +2,13 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -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:provider/provider.dart'; import 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart'; import 'OrderLogPage.dart'; @@ -17,8 +18,7 @@ class AmbulanceReq extends StatefulWidget { _AmbulanceReqState createState() => _AmbulanceReqState(); } -class _AmbulanceReqState extends State - with SingleTickerProviderStateMixin { +class _AmbulanceReqState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); @@ -36,101 +36,61 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); + ProjectViewModel projectViewModel = Provider.of(context); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); return BaseView( onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + showNewAppBarTitle: true, + showNewAppBar: true, appBarTitle: TranslationBase.of(context).transportationService, description: TranslationBase.of(context).infoAmbulance, imagesInfo: imagesInfo, baseViewModel: model, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.90, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.7), - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.40, - child: Center( - child: Texts(TranslationBase.of(context).transportationService), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).ordersLog), - ), - ), - ], - ), - ), - ), - ), + body: Column( + children: [ + TabBar( + isScrollable: false, + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [ + Text(TranslationBase.of(context).transportationService), + Text(TranslationBase.of(context).ordersLog), ], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AmbulanceRequestIndexPage( - amRequestViewModel: model, - ), - OrderLogPage( - amRequestViewModel: model, - ) - ], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AmbulanceRequestIndexPage( + amRequestViewModel: model, + ), + OrderLogPage( + amRequestViewModel: model, + ) + ], + ), + ) + ], ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index cb77b22c..bf8cc676 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -56,7 +56,7 @@ class _AmbulanceRequestIndexPageState extends State { child: Column( children: [ SizedBox( - height: 80, + height: 10, ), Container( margin: EdgeInsets.only(left: 18, right: 18), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index 67b9d82b..11950cef 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -174,7 +174,7 @@ class _BillAmountState extends State { ), Texts( TranslationBase.of(context).selectAmbulate, - bold: true, + bold: false, ), SizedBox( height: 5, @@ -196,7 +196,9 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).wheelchair), + title: Text(TranslationBase.of(context).wheelchair, style: TextStyle( + fontSize: 14.0 + )), leading: Radio( value: Ambulate.Wheelchair, groupValue: _ambulate, @@ -225,7 +227,9 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).walker), + title: Text(TranslationBase.of(context).walker, style: TextStyle( + fontSize: 14.0 + )), leading: Radio( value: Ambulate.Walker, groupValue: _ambulate, @@ -261,7 +265,9 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).stretcher), + title: Text(TranslationBase.of(context).stretcher, style: TextStyle( + fontSize: 14.0 + )), leading: Radio( value: Ambulate.Stretcher, groupValue: _ambulate, @@ -290,7 +296,9 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).none), + title: Text(TranslationBase.of(context).none, style: TextStyle( + fontSize: 14.0 + )), leading: Radio( value: Ambulate.None, groupValue: _ambulate, @@ -326,21 +334,20 @@ class _BillAmountState extends State { ), ), bottomSheet: Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 90, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).next, + () { setState(() { widget.patientER_RC.transportationDetails.ambulate = _ambulate.selectAmbulateNumber(); + widget.patientER_RC.transportationDetails.ambulateTitle = _ambulate.getAmbulateTitle(context); widget.patientER_RC.transportationDetails.notes = note; // widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); widget.changeCurrentTab(3); }); }, - label: TranslationBase.of(context).next, + // label: TranslationBase.of(context).next, ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index ce4eb2f7..cecf8c5d 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -11,7 +11,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; 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/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; @@ -264,7 +264,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), + Texts(getHospitalName(TranslationBase.of(context).selectHospital)), Icon( Icons.arrow_drop_down, size: 24, @@ -368,13 +368,13 @@ class _PickupLocationState extends State { ), ), bottomSheet: Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 90, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton( + // color: Colors.grey[800], + // textColor: Colors.white, + TranslationBase.of(context).next, + () { if (_result == null || _selectedHospital == null) AppToast.showErrorToast(message: TranslationBase.of(context).selectAll); else @@ -432,7 +432,7 @@ class _PickupLocationState extends State { widget.changeCurrentTab(2); }); }, - label: TranslationBase.of(context).next, + // label: TranslationBase.of(context).next, ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index aad8eb3b..d2a74505 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -53,7 +53,6 @@ class _SelectTransportationMethodState extends State } else { if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1]; } - } @override @@ -280,13 +279,11 @@ class _SelectTransportationMethodState extends State ), ), bottomSheet: Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 90, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).next, + () { setState(() { // widget.patientER.transportationMethodId = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); // widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; @@ -314,10 +311,8 @@ class _SelectTransportationMethodState extends State // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble(); widget.changeCurrentTab(1); - }); }, - label: TranslationBase.of(context).next, ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index beebc2f8..21bb5e89 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -1,12 +1,14 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; 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:provider/provider.dart'; class Summary extends StatefulWidget { final Function changeCurrentTab; @@ -23,6 +25,7 @@ class Summary extends StatefulWidget { class _SummaryState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, isShowAppBar: false, @@ -33,7 +36,9 @@ class _SummaryState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).RRTSummary), - SizedBox(height: 5,), + SizedBox( + height: 5, + ), Container( width: double.infinity, padding: EdgeInsets.all(10), @@ -48,10 +53,15 @@ class _SummaryState extends State { TranslationBase.of(context).transportMethod, color: Colors.grey, ), - Texts( - '${widget.patientER_RC.patientERTransportationMethod.text}', - bold: true, - ), + projectViewModel.isArabic + ? Texts( + '${widget.patientER_RC.patientERTransportationMethod.textN}', + bold: true, + ) + : Texts( + '${widget.patientER_RC.patientERTransportationMethod.text}', + bold: true, + ), SizedBox( height: 8, ), @@ -93,7 +103,7 @@ class _SummaryState extends State { color: Colors.grey, ), Texts( - '${widget.patientER_RC.transportationDetails.ambulate}', + '${widget.patientER_RC.transportationDetails.ambulateTitle}', bold: true, ), SizedBox( @@ -113,16 +123,20 @@ class _SummaryState extends State { ], ), ), - SizedBox(height: 20,), - Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,), - SizedBox(height: 5,), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context).billAmount, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), Container( height: 55, padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8) - ), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Texts(TranslationBase.of(context).patientShareTotal + ':'), Texts(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}')], @@ -134,16 +148,11 @@ class _SummaryState extends State { ), ), bottomSheet: Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 90, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - label: TranslationBase.of(context).send, - onTap: () async { - await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); - }), + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton(TranslationBase.of(context).send, () async { + await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); + }), ), ); } diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index cbbf2572..6ac4d557 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -81,7 +81,7 @@ class _StatusFeedbackPageState extends State { fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), - Text(model.cOCItemList[index].date.split(" ")[1], + Text(model.cOCItemList[index].date.split(" ")[1].substring(0, 4), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index b68c9d86..16995546 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -47,18 +47,15 @@ class _InsuranceCardState extends State { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: CustomColors.appBackgroudGreyColor, - floatingActionButton: FloatingActionButton( + floatingActionButton: FloatingActionButton.extended( onPressed: () { Navigator.push(context, FadePage(page: InsuranceUpdate())); }, backgroundColor: CustomColors.accentColor, - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Image.asset( - 'assets/images/medical/insurance_update_icon_.png', - color: Colors.white, - ), - ), + label: Text(TranslationBase.of(context).update, style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.bold + )), ), body: Container( child: ListView.separated( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index f96cf7f4..ceadc7e4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -541,7 +541,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(0); }, ), - projectViewModel.isLogin && model.notificationsCount != null + projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild ? new Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 9eacff2d..bc92bc08 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -17,42 +17,74 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; -class ConfirmPaymentPage extends StatelessWidget { +class ConfirmPaymentPage extends StatefulWidget { final AdvanceModel advanceModel; final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final String selectedPaymentMethod; - MyInAppBrowser browser; AuthenticatedUser authenticatedUser; + + ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); + + @override + _ConfirmPaymentPageState createState() => _ConfirmPaymentPageState(); +} + +class _ConfirmPaymentPageState extends State { + MyInAppBrowser browser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + String transID = ""; - ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); + void submit(MyBalanceViewModel model, code) { + final activationCode = code; + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + model.checkActivationCodeForAdvancePayment(activationCode: activationCode).then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + Navigator.pop(context, true); + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.projectID = widget.patientInfoAndMobileNumber.projectID; + openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); + }); + } @override Widget build(BuildContext context) { - void showSMSDialog() { - showDialog( - context: context, - barrierDismissible: false, - child: ConfirmSMSDialog( - phoneNumber: patientInfoAndMobileNumber.mobileNumber, - ), - ).then((value) { - print("dialog dismissed"); - print(value); - if (value != null && value) { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.projectID = patientInfoAndMobileNumber.projectID; - openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null); - } - }); + void showSMSDialog(MyBalanceViewModel model) { + new SMSOTP( + context, + 1, + widget.patientInfoAndMobileNumber.mobileNumber, + (value) { + submit(model, value); + }, + () => { + Navigator.pop(context), + }, + ).displayDialog(context); + + // showDialog( + // context: context, + // barrierDismissible: false, + // child: ConfirmSMSDialog( + // phoneNumber: patientInfoAndMobileNumber.mobileNumber, + // ), + // ).then((value) { + // print("dialog dismissed"); + // print(value); + // if (value != null && value) { + // AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + // appo.projectID = patientInfoAndMobileNumber.projectID; + // openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null); + // } + // }); } return BaseView( @@ -88,10 +120,10 @@ class ConfirmPaymentPage extends StatelessWidget { height: 100.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, - child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)), + child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), ), Text( - '${advanceModel.amount} SAR', + '${widget.advanceModel.amount} SAR', style: TextStyle( fontSize: 20, fontWeight: FontWeight.w900, @@ -110,7 +142,7 @@ class ConfirmPaymentPage extends StatelessWidget { margin: EdgeInsets.all(3), child: NewTextFields( hintText: TranslationBase.of(context).fileNumber, - initialValue: advanceModel.fileNumber, + initialValue: widget.advanceModel.fileNumber, isEnabled: false, ), ), @@ -120,7 +152,7 @@ class ConfirmPaymentPage extends StatelessWidget { margin: EdgeInsets.all(3), child: NewTextFields( hintText: TranslationBase.of(context).name, - initialValue: patientInfoAndMobileNumber.firstName, + initialValue: widget.patientInfoAndMobileNumber.firstName, isEnabled: false, ), ), @@ -132,7 +164,7 @@ class ConfirmPaymentPage extends StatelessWidget { ), NewTextFields( hintText: TranslationBase.of(context).mobileNumber, - initialValue: patientInfoAndMobileNumber.mobileNumber, + initialValue: widget.patientInfoAndMobileNumber.mobileNumber, isEnabled: false, ), SizedBox( @@ -148,7 +180,7 @@ class ConfirmPaymentPage extends StatelessWidget { ), NewTextFields( hintText: TranslationBase.of(context).notes, - initialValue: advanceModel.note, + initialValue: widget.advanceModel.note, isEnabled: false, ), ], @@ -168,9 +200,9 @@ class ConfirmPaymentPage extends StatelessWidget { disabled: model.state == ViewState.Busy, onTap: () { GifLoaderDialogUtils.showMyDialog(context); - model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) { + model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); + if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model); }); }, ), @@ -208,10 +240,10 @@ class ConfirmPaymentPage extends StatelessWidget { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber)); + transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); - browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType, - advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false, "3", ""); + browser.openPaymentBrowser(amount, "Advance Payment", transID, widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel.email, paymentMethod, + widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", ""); } onBrowserLoadStart(String url) { @@ -263,8 +295,8 @@ class ConfirmPaymentPage extends StatelessWidget { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - service.HIS_createAdvancePayment(appo, advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], patientInfoAndMobileNumber.patientType, - advanceModel.patientName, advanceModel.fileNumber, AppGlobal.context) + service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, + widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); diff --git a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart index 96283aa8..e081e32b 100644 --- a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart +++ b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart @@ -77,7 +77,7 @@ class PrescriptionOrderOverview extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts(prescriptionReportList[index].itemDescription.isNotEmpty + child: Text(prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)), )), @@ -130,7 +130,7 @@ class PrescriptionOrderOverview extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(prescriptionReportEnhList[index].itemDescription), + Text(prescriptionReportEnhList[index].itemDescription), ], ), ), diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index dffec021..07947508 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -212,22 +212,43 @@ class Utils { hasBadge: true, isEnable: projectViewModel.havePrivilege(5)), ), - Positioned( - right: 8, - top: 4, - child: Badge( - toAnimate: false, - elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)), - ), - ), - ), + projectViewModel.isArabic + ? !projectViewModel.user.isFamily + ? Positioned( + left: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container() + : !projectViewModel.user.isFamily + ? Positioned( + right: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), ]) : MedicalProfileItem( title: TranslationBase.of(context).myAppointments, @@ -509,38 +530,42 @@ class Utils { hasBadge: true, isEnable: projectViewModel.havePrivilege(5)), projectViewModel.isArabic - ? Positioned( - left: 8, - top: 4, - child: Badge( - toAnimate: false, - elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Positioned( - right: 8, - top: 4, - child: Badge( - toAnimate: false, - elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ), + ? !projectViewModel.isLoginChild + ? Positioned( + left: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container() + : !projectViewModel.isLoginChild + ? Positioned( + right: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), ]) : MedicalProfileItem( title: TranslationBase.of(context).myAppointments, diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 1515b239..820c6652 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -1,5 +1,6 @@ import 'package:badges/badges.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -25,6 +26,7 @@ class BottomNavigationItem extends StatelessWidget { @override Widget build(BuildContext context) { var model = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); return Expanded( child: SizedBox( // height: 72.0, @@ -61,7 +63,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ) - : (authenticatedUserObject.isLogin && model.isShowBadge) + : (authenticatedUserObject.isLogin && model.isShowBadge && !projectViewModel.isLoginChild) ? Stack( alignment: AlignmentDirectional.center, children: [ diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 15e32a48..b5a3c869 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -104,7 +104,7 @@ class ShowChart extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: horizontalInterval, verticalInterval: horizontalInterval), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -137,7 +137,7 @@ class ShowChart extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - interval: 3.0, + // interval: 3.0, margin: 12, ), ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 83e70064..2599dcd4 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -329,7 +329,7 @@ class _AppDrawerState extends State { letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider, - count: toDoProvider.notificationsCount != 0 + count: toDoProvider.notificationsCount != "0" && !projectProvider.isLoginChild ? new Container( padding: EdgeInsets.all(4), margin: EdgeInsets.all(2), @@ -358,7 +358,8 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - Navigator.push(context, FadePage(page: NotificationsPage())); + if(!projectProvider.user.isFamily) + Navigator.push(context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3))