diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 86763360..5e401c48 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1512,4 +1512,9 @@ const Map localizedValues = { "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"}, "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"}, "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"}, + "RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"}, + "PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"}, + "OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"}, + "inPrgress": {"en": "In Progress", "ar": "في تقدم"}, + "locked": {"en": "Locked", "ar": "مقفل"}, }; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 9e2245e6..37c0c7be 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -63,7 +63,7 @@ class FeedbackService extends BaseService { Map body = new Map(); body['IdentificationNo'] = user.patientIdentificationNo; body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); - body['Searching_type'] = '1'; + body['Searching_type'] = 1; if (BASE_URL.contains('uat')) { body['ForDemo'] = true; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 651165e4..0da1a273 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -40,6 +40,7 @@ class DoctorList { String setupID; List speciality; dynamic workingHours; + dynamic decimalDoctorRate; DoctorList( {this.clinicID, @@ -82,7 +83,8 @@ class DoctorList { this.serviceID, this.setupID, this.speciality, - this.workingHours}); + this.workingHours, + this.decimalDoctorRate}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -127,6 +129,7 @@ class DoctorList { if (json.containsKey('Speciality') && json['Speciality']!=null) speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; + decimalDoctorRate = json['DecimalDoctorRate']; } Map toJson() { @@ -172,6 +175,7 @@ class DoctorList { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['WorkingHours'] = this.workingHours; + data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; } } diff --git a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart index a5a43cef..f7294f3c 100644 --- a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart +++ b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart @@ -34,10 +34,13 @@ class ListDentalAppointments { int invoiceNo; int status; String arrivedOn; - String doctorName; - dynamic doctorNameN; + dynamic doctorName; + String doctorNameN; String clinicName; + dynamic decimalDoctorRate; String doctorImageURL; + dynamic doctorRate; + int patientNumber; String projectName; ListDentalAppointments( @@ -55,7 +58,10 @@ class ListDentalAppointments { this.doctorName, this.doctorNameN, this.clinicName, + this.decimalDoctorRate, this.doctorImageURL, + this.doctorRate, + this.patientNumber, this.projectName}); ListDentalAppointments.fromJson(Map json) { @@ -73,7 +79,10 @@ class ListDentalAppointments { doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; clinicName = json['ClinicName']; + decimalDoctorRate = json['DecimalDoctorRate']; doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + patientNumber = json['PatientNumber']; projectName = json['ProjectName']; } @@ -93,8 +102,12 @@ class ListDentalAppointments { data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; data['ClinicName'] = this.clinicName; + data['DecimalDoctorRate'] = this.decimalDoctorRate; data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['PatientNumber'] = this.patientNumber; data['ProjectName'] = this.projectName; return data; } } + diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index 4de0e61d..ac0a8599 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -28,6 +29,29 @@ class OrdersLogDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); void showConfirmMessage(CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, + onTap: () { + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + GifLoaderDialogUtils.showMyDialog(context); + await model.updateCmcPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + GifLoaderDialogUtils.hideDialog(context); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); + await model.getCmcAllPresOrders(); + GifLoaderDialogUtils.hideDialog(context); + } + }); + }, + )); + return; + + // todo 'sikander' remove useless code showDialog( context: context, child: ConfirmCancelOrderDialog( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart index 45d34e24..5d1d5210 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -1,5 +1,8 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; import 'new_e_referral_step_three_page.dart'; @@ -9,18 +12,15 @@ class StartIndexForNewEReferral extends StatefulWidget { StartIndexForNewEReferral(); @override - _StartIndexForNewEReferralState createState() => - _StartIndexForNewEReferralState(); + _StartIndexForNewEReferralState createState() => _StartIndexForNewEReferralState(); } -class _StartIndexForNewEReferralState extends State - with TickerProviderStateMixin { +class _StartIndexForNewEReferralState extends State with TickerProviderStateMixin { PageController _controller; - int _currentIndex = 1; + int _currentIndex = 0; int pageSelected = 2; - CreateEReferralRequestModel createEReferralRequestModel = - new CreateEReferralRequestModel(); + CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel(); @override void initState() { @@ -40,37 +40,139 @@ class _StartIndexForNewEReferralState extends State @override Widget build(BuildContext context) { return Scaffold( - body: SafeArea( - child: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.78, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - NewEReferralStepOnePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepTowPage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepThreePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - ], + body: Container( + height: double.infinity, + child: Column( + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12,right: 12,top: 12), + child: Row( + children: [ + Expanded( + child: showProgress( + title: TranslationBase.of(context).RequesterInfo, + status: _currentIndex == 0 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 0 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green, + ), + ), + Expanded( + child: showProgress( + title: TranslationBase.of(context).patientInfo, + status: _currentIndex == 1 + ? TranslationBase.of(context).inPrgress + : _currentIndex > 1 + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + color: _currentIndex == 1 + ? CustomColors.orange + : _currentIndex > 1 + ? CustomColors.green + : CustomColors.grey2, + ), + ), + showProgress( + title: TranslationBase.of(context).otherInfo, + status: _currentIndex == 2 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked, + color: _currentIndex == 2 + ? CustomColors.orange + : _currentIndex > 3 + ? CustomColors.green + : CustomColors.grey2, + isNeedBorder: false, + ), + ], + ), ), - ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + NewEReferralStepOnePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepTowPage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepThreePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + ], + ), + ), + ], ), ), ); } + + Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 26, + height: 26, + decoration: containerRadius(color, 200), + child: Icon( + Icons.done, + color: Colors.white, + size: 16, + ), + ), + if (isNeedBorder) + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: mDivider(Colors.grey), + )), + ], + ), + mHeight(8), + Text( + title, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ), + mHeight(2), + Container( + padding: EdgeInsets.all(5), + decoration: containerRadius(color.withOpacity(0.2), 4), + child: Text( + status, + style: TextStyle( + fontSize: 8, + fontWeight: FontWeight.w600, + letterSpacing: -0.32, + color: color, + ), + ), + ), + ], + ) + ], + ); + } } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index d7e2d099..3d260317 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -12,12 +12,15 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dial import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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'; import 'package:flutter/cupertino.dart'; @@ -36,13 +39,14 @@ class NewEReferralStepOnePage extends StatefulWidget { class _NewEReferralStepOnePageState extends State { TextEditingController _nameTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); + GetAllRelationshipTypeResponseModel _selectedRelation; String email; AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); ProjectViewModel projectViewModel; + String mobileNo = ""; // todo create a model for Country // todo use country from the json @@ -59,11 +63,11 @@ class _NewEReferralStepOnePageState extends State { SMSOTP( context, 1, - _selectedCountry['code'] + _mobileTextController.text, - (value) { + _selectedCountry['code'] + mobileNo, + (value) { submit(model, value); }, - () => { + () => { Navigator.pop(context), }, ).displayDialog(context); @@ -74,108 +78,135 @@ class _NewEReferralStepOnePageState extends State { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRelationTypes(), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Center( - child: Texts( - TranslationBase.of(context).referralRequesterInformation, + onModelReady: (model) => model.getRelationTypes(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).enterReferralRequesterName, - controller: _nameTextController, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + Text( + TranslationBase.of(context).referralRequesterInformation, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), ), - ), - SizedBox( - height: 12, - ), - MobileNumberTextFiled( - controller: _mobileTextController, - code: _selectedCountry == null ? "11" : _selectedCountry["code"], - ), - SizedBox( - height: 12, - ), - Center( - child: Texts( - TranslationBase.of(context).requesterRelationship, - textAlign: TextAlign.center, + SizedBox( + height: 12, ), - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)], + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).enterReferralRequesterName, "", _nameTextController, isInputTypeNum: true)), + SizedBox( + height: 12, + ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: () => confirmSelectRelationTypeDialog(model.relationTypes), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectRelationship, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getRelationName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], + ), ), ), - ), - ], + ], + ), ), ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - width: double.infinity, - padding: EdgeInsets.all(9), - child: DefaultButton( - TranslationBase.of(context).next, - (_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty) - ? null - : () async { - Future.delayed(new Duration(milliseconds: 300)).then((value) async { - GifLoaderDialogUtils.showMyDialog(context); - SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( - zipCode: _selectedCountry['code'], - patientMobileNumber: int.parse(_mobileTextController.text), - ); - await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); - GifLoaderDialogUtils.hideDialog(context); - showSMSDialog(model); - }); - }, - disabledColor: Colors.grey, + Card( + margin: EdgeInsets.zero, + shape: cardRadius(0), + elevation: 20, + child: Container( + // color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + width: double.infinity, + child: DefaultButton( + TranslationBase.of(context).next, + (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty) + ? null + : () async { + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + GifLoaderDialogUtils.showMyDialog(context); + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel( + zipCode: _selectedCountry['code'], + patientMobileNumber: int.parse(mobileNo), + ); + await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); + GifLoaderDialogUtils.hideDialog(context); + showSMSDialog(model); + }); + }, + disabledColor: Colors.grey, + ), + ), ), - ))); + ], + ), + ), + ), + ); } void submit(EReferralViewModel model, code) async { @@ -195,7 +226,7 @@ class _NewEReferralStepOnePageState extends State { Navigator.of(context).pop(); widget.changePageViewIndex(1); widget.createEReferralRequestModel.requesterName = _nameTextController.text; - widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo; widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD; } }); @@ -216,20 +247,93 @@ class _NewEReferralStepOnePageState extends State { ); } - void confirmSelectCountryTypeDialog() { - showDialog( - context: context, - child: SelectCountryDialog( - selectedCountry: _selectedCountry, - onValueSelected: (value) { - setState(() { - _selectedCountry = value; - }); - }, + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), ), ); } + // void confirmSelectCountryTypeDialog() { + // showDialog( + // context: context, + // child: SelectCountryDialog( + // selectedCountry: _selectedCountry, + // onValueSelected: (value) { + // setState(() { + // _selectedCountry = value; + // }); + // }, + // ), + // ); + // } + String getRelationName() { if (_selectedRelation != null) { if (projectViewModel.isArabic) { @@ -237,7 +341,7 @@ class _NewEReferralStepOnePageState extends State { } return _selectedRelation.textEn; } else - return TranslationBase.of(context).selectRelationship; + return ""; } String getCountryName() { diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 7a1a954b..858a65a5 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.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'; @@ -66,316 +67,297 @@ class _NewEReferralStepThreePageState extends State { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - Center( - child: Texts( - TranslationBase.of(context).otherInfo, - textAlign: TextAlign.center, - ), - ), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 9), - child: Texts( - TranslationBase.of(context).medicalReport, - color: Colors.grey, - fontSize: 17, - ), - ), - ], - ), - InkWell( - onTap: () { - ImageOptions.showImageOptions( - context, - (String image, File file) { - setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); - medicalReportImages.add(eReferralAttachment); - }); - }, - ); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - TranslationBase.of(context).selectAttachment, - variant: 'bodyText', - textAlign: TextAlign.center, - ), - ], - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + TranslationBase.of(context).otherInfo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).medicalReport, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, ), ), - ), - SizedBox( - height: 12, - ), - ...List.generate( + + ...List.generate( medicalReportImages.length, (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + padding: EdgeInsets.only(top: 6,bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - medicalReportImages[index].fileName, - ), - ], + Texts( + medicalReportImages[index].fileName, ), - InkWell( - onTap: () { - setState(() { - medicalReportImages.remove(medicalReportImages[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) ], ), - )), - ], + InkWell( + onTap: () { + setState(() { + medicalReportImages.remove(medicalReportImages[index]); + }); + }, + child: Icon( + Icons.close, + color: Colors.red[300], + )) + ], + ), + ), + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions( + context, + (String image, File file) { + setState(() { + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); + medicalReportImages.add(eReferralAttachment); + }); + }, + ); + }, + child: Padding( + padding: EdgeInsets.only(top: 12,bottom: 12), + child: Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + decoration: TextDecoration.underline, + color: CustomColors.accentColor, + ), + ), + ), + ), + ], + ), ), - ), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( - children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).preferredBranch, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - key: projectDropdownKey, - hint: Text(TranslationBase.of(context).selectPreferredBranch), - value: projectDropdownValue, - iconSize: 0, - isExpanded: true, - style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.mainProjectID.toString() + "," + item.name.toString(), - child: new Text(item.name), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - projectDropdownValue = newValue; - print(projectDropdownValue); - }); - }, - ), - ), + Icon(Icons.attach_file), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(top: 10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).preferredBranch, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: Text(TranslationBase.of(context).selectPreferredBranch), + value: projectDropdownValue, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString() + "," + item.name.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + print(projectDropdownValue); + }); + }, ), - ], + ), ), - ), - Icon(Icons.keyboard_arrow_down), - ], - )), - ], - ), - ), - SizedBox( - height: 12, - ), - Container( - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], + )), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - children: [ - Checkbox( - value: isPatientInsured, - activeColor: Colors.black38, - onChanged: (bool newValue) { - setState(() { - isPatientInsured = newValue; - }); - }), - Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - TranslationBase.of(context).insuredPatientReferral, - fontSize: 17, - ), - ), - ], + Checkbox( + value: isPatientInsured, + activeColor: Colors.black38, + onChanged: (bool newValue) { + setState(() { + isPatientInsured = newValue; + }); + }), + Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + TranslationBase.of(context).insuredPatientReferral, + fontSize: 17, + ), ), ], ), ], ), + ], + ), + ), + if (isPatientInsured) + SizedBox( + height: 12, + ), + Opacity( + opacity: isPatientInsured ? 1 : 0, + child: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, ), - if (isPatientInsured) - SizedBox( - height: 12, - ), - Opacity( - opacity: isPatientInsured ? 1 : 0, - child: Container( - padding: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - child: Column( - children: [ - InkWell( - onTap: () { - ImageOptions.showImageOptions(context, (String image, File file) { - setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); - - insuredPatientImages = [eReferralAttachment]; - }); - }); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - 'selected attachment', - variant: 'bodyText', - textAlign: TextAlign.center, - ), - ], - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).medicalReport, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, ), ), - ), - SizedBox( - height: 12, - ), - ...List.generate( + + ...List.generate( insuredPatientImages.length, (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + padding: EdgeInsets.only(top: 6,bottom: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - 'image ${index + 1}.png', - ), - ], + Texts( + 'image ${index + 1}.png', ), - InkWell( - onTap: () { - setState(() { - insuredPatientImages.remove(insuredPatientImages[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) ], ), - )), - ], + InkWell( + onTap: () { + setState(() { + insuredPatientImages.remove(insuredPatientImages[index]); + }); + }, + child: Icon( + Icons.close, + color: Colors.red[300], + ), + ) + ], + ), + ), + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image, File file) { + setState(() { + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image); + + insuredPatientImages = [eReferralAttachment]; + }); + }); + }, + child: Padding( + padding: const EdgeInsets.only(top: 12,bottom: 12), + child: Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + decoration: TextDecoration.underline, + color: CustomColors.accentColor, + ), + ), + ), + ), + ], + ), ), - ), - ), - SizedBox( - height: 12, + Icon(Icons.attach_file), + ], ), - ], + ), ), - ), + ], ), ), ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 734c5f28..ee477127 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -7,18 +7,20 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../dialogs/select_city_dialog.dart'; - class NewEReferralStepTowPage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; @@ -32,20 +34,14 @@ class NewEReferralStepTowPage extends StatefulWidget { class _NewEReferralStepTowPageState extends State { TextEditingController _patientNameTextController = TextEditingController(); TextEditingController _patientIdentificationTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); - GetAllCitiesResponseModel _selectedCity ; + String mobileNo = ""; + GetAllCitiesResponseModel _selectedCity; + GetAllSharedRecordsByStatusList selectedPatientFamily; // todo create a model for Country // todo use country from the json - dynamic _selectedCountry = { - "name": "Saudi Arabia", - "name_ar": "المملكة العربية السعودية", - "code": "+966", - "countryCode": "SA", - "pattern": "5xxxxxxxx", - "maxLength": 9 - }; + dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; @@ -57,143 +53,222 @@ class _NewEReferralStepTowPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getAllCities(), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - Center( - child: Texts( - TranslationBase.of(context).patientInfo, -// "Patient information", - textAlign: TextAlign.center, - ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).enterIdentificationNumber, - controller: _patientIdentificationTextController, - keyboardType:TextInputType.number , - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).patientName, - controller: _patientNameTextController, - ), - SizedBox( - height: 12, + onModelReady: (model) => model.getAllCities(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + TranslationBase.of(context).patientInfo, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getCountryName()), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - SizedBox( - height: 12, - ), - MobileNumberTextFiled( - controller: _mobileTextController, - code: _selectedCountry == null - ? "11" - : _selectedCountry["code"], + ), + SizedBox( + height: 12, + ), + inputWidget(TranslationBase.of(context).enterIdentificationNumber, "", _patientIdentificationTextController, isInputTypeNum: true), + SizedBox( + height: 12, + ), + inputWidget(TranslationBase.of(context).patientName, "", _patientNameTextController, isInputTypeNum: true), + SizedBox( + height: 12, + ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + SizedBox( + height: 12, + ), + Text( + TranslationBase.of(context).patientLocated, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), - SizedBox( - height: 12, - ), - Center( - child: Texts( - TranslationBase.of(context).patientLocated, - textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCityDialog( - model.allCities), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getRelationName()), - Icon(Icons.arrow_drop_down) - ], - ), + child: InkWell( + onTap: () => confirmSelectCityDialog(model.allCities), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectCity, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getRelationName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], ), ), - SizedBox( - height: 12, - ), - - SizedBox( - height: 12, - ), - ], - ), + ), + SizedBox( + height: 12, + ), + ], ), ), ), ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - width: double.infinity, - padding: EdgeInsets.all(9), - child: DefaultButton( - TranslationBase.of(context).next, - (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty|| - _selectedCity == null || - _mobileTextController.text.isEmpty) ? null : () { - this.widget.changePageViewIndex(2); - this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); - this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; - this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; - this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); - this.widget.createEReferralRequestModel.cityName = _selectedCity.description; - }, - disabledColor: Colors.grey, + Card( + margin: EdgeInsets.zero, + shape: cardRadius(0), + elevation: 20, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(12), + child: DefaultButton( + TranslationBase.of(context).next, + (_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty || _selectedCity == null || mobileNo.isEmpty) + ? null + : () { + this.widget.changePageViewIndex(2); + this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text); + this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; + this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo; + this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); + this.widget.createEReferralRequestModel.cityName = _selectedCity.description; + }, + disabledColor: Colors.grey, + ), ), - ))); - + ) + ], + ), + ), + ); + } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); } - void confirmSelectCityDialog( - List cities) { + void confirmSelectCityDialog(List cities) { showDialog( context: context, child: SelectCityDialog( @@ -238,12 +313,7 @@ class _NewEReferralStepTowPageState extends State { } class MobileNumberTextFiled extends StatelessWidget { - const MobileNumberTextFiled({ - Key key, - this.controller, - this.code - }) : super(key: key); - + const MobileNumberTextFiled({Key key, this.controller, this.code}) : super(key: key); final TextEditingController controller; final String code; @@ -252,8 +322,7 @@ class MobileNumberTextFiled extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: EdgeInsets.all(5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white), child: Row(children: [ Expanded( flex: 1, @@ -274,8 +343,7 @@ class MobileNumberTextFiled extends StatelessWidget { child: TextField( controller: controller, keyboardType: TextInputType.phone, - decoration: InputDecoration( - border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), + decoration: InputDecoration(border: InputBorder.none, hintText: TranslationBase.of(context).mobileNumber), ), ), ) diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart index 2fb7e41a..52338edd 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_city_dialog.dart @@ -10,8 +10,7 @@ class SelectCityDialog extends StatefulWidget { final Function(GetAllCitiesResponseModel) onValueSelected; GetAllCitiesResponseModel selectedCity; - SelectCityDialog( - {Key key, this.cities, this.onValueSelected, this.selectedCity}); + SelectCityDialog({Key key, this.cities, this.onValueSelected, this.selectedCity}); @override _SelectCityDialogState createState() => _SelectCityDialogState(); @@ -26,104 +25,109 @@ class _SelectCityDialogState extends State { @override Widget build(BuildContext context) { - return SimpleDialog( - children: [ - Column( - children: [ - Divider(), - ...List.generate( - widget.cities.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, + return Dialog( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.selectedCity = widget.cities[index]; - }); - }, - child: ListTile( - title: Text(widget.cities[index].description), - leading: Radio( - value: widget.cities[index], - groupValue: widget.selectedCity, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - widget.selectedCity = value; - }); - }, - ), - ), + ...List.generate( + widget.cities.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, ), - ) - ], - ), - SizedBox( - height: 5.0, + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedCity = widget.cities[index]; + }); + }, + child: ListTile( + title: Text(widget.cities[index].description), + leading: Radio( + value: widget.cities[index], + groupValue: widget.selectedCity, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedCity = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), ), ], ), ), - SizedBox( - height: 5.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, ), ), ), ), ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(widget.selectedCity); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedCity); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), ), ), - ], - ) - ], - ) - ], + ), + ], + ) + ], + ), ); } } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 1308532f..78d3bca3 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -84,6 +84,7 @@ class _EReferralPageState extends State Expanded( child: TabBarView( physics: BouncingScrollPhysics(), + controller: _tabController, children: [ StartIndexForNewEReferral(), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 356e8eb1..048af5a2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; +import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -36,7 +37,7 @@ class SearchForReferralsPage extends StatefulWidget { class _SearchForReferralsPageState extends State { TextEditingController _searchTextController = TextEditingController(); - TextEditingController _mobileTextController = TextEditingController(); + String mobileNo = ""; bool _isSubmitted = false; dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9}; @@ -80,55 +81,106 @@ class _SearchForReferralsPageState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () => selectSearchCriteriaDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], + // InkWell( + // onTap: () => selectSearchCriteriaDialog(), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], + // ), + // ), + // ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), ), - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", - controller: _searchTextController, - onChanged: (_) { - setState(() {}); - }, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmSelectCountryTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: InkWell( + onTap: () => selectSearchCriteriaDialog(), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectSearchCriteria, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + Text( + getSearchCriteriaName(), + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + ], + ), + ), + Icon(Icons.arrow_drop_down), + ], ), ), ), SizedBox( height: 12, ), - MobileNumberTextFiled( - controller: _mobileTextController, - onChange: (_) { - setState(() {}); - }, - code: _selectedCountry == null ? "11" : _selectedCountry["code"], + + inputWidget(selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", "", _searchTextController, isInputTypeNum: true), + + SizedBox( + height: 12, ), + PhoneNumberSelectorWidget(onNumberChange: (value) { + setState(() { + mobileNo = value; + }); + }, onCountryChange: (value) { + setState(() { + _selectedCountry = value; + }); + }), + // InkWell( + // onTap: () => confirmSelectCountryTypeDialog(), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + // MobileNumberTextFiled( + // controller: _mobileTextController, + // onChange: (_) { + // setState(() {}); + // }, + // code: _selectedCountry == null ? "11" : _selectedCountry["code"], + // ), SizedBox( height: 12, ), @@ -200,11 +252,11 @@ class _SearchForReferralsPageState extends State { padding: EdgeInsets.all(14), child: DefaultButton( TranslationBase.of(context).search, - (_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty) + (_searchTextController.text.isEmpty || mobileNo.isEmpty) ? null : () async { SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( - patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text, + patientMobileNumber: _selectedCountry['code'] + mobileNo, ); if (selectedCriteria.value == 1) { searchEReferralRequestModel.identificationNo = _searchTextController.text; @@ -258,6 +310,79 @@ class _SearchForReferralsPageState extends State { ); } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, + {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + String getSearchCriteriaName() { return selectedCriteria.name; } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 12879ac9..948ee8d6 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -8,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -26,6 +25,28 @@ class OrdersLogDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); void showConfirmMessage(HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + model.setState(ViewState.Busy); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + ), + ); + return; + + // todo 'sikander' remove useless code + showDialog( context: context, child: ConfirmCancelOrderDialog( @@ -49,128 +70,130 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - body: model.hhcAllPresOrders.length > 0 ? ListView.separated( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - itemBuilder: (context, index) { - GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; + body: model.hhcAllPresOrders.length > 0 + ? ListView.separated( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + itemBuilder: (context, index) { + GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index]; - int status = order.status; - String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; - Color _color; - if (status == 1) { - //pending - _color = Color(0xffCC9B14); - } else if (status == 2) { - //processing - _color = Color(0xff2E303A); - } else if (status == 3) { - //completed - _color = Color(0xff359846); - } else if (status == 4) { - //cancel // Rejected - _color = Color(0xffD02127); - } - return Container( - decoration: BoxDecoration( - color: _color, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - ), - child: Container( - // decoration: containerColorRadiusLeft(Colors.white, 12), - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), - padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.only( - bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), - topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + int status = order.status; + String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; + Color _color; + if (status == 1) { + //pending + _color = Color(0xffCC9B14); + } else if (status == 2) { + //processing + _color = Color(0xff2E303A); + } else if (status == 3) { + //completed + _color = Color(0xff359846); + } else if (status == 4) { + //cancel // Rejected + _color = Color(0xffD02127); + } + return Container( + decoration: BoxDecoration( + color: _color, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - ), - // clipBehavior: Clip.antiAlias, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _statusDisp, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), - ), - SizedBox(height: 6), - Text( - '${TranslationBase.of(context).requestID}: ${order.iD}', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Row( + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), + padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.only( + bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + ), + ), + // clipBehavior: Clip.antiAlias, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).hospital + ": ", - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + _statusDisp, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), ), - Expanded( - child: Text( - !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), - ), + SizedBox(height: 6), + Text( + '${TranslationBase.of(context).requestID}: ${order.iD}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).hospital + ": ", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + Expanded( + child: Text( + !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + ), + ], + ) ], - ) - ], - ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), + ), ), - SizedBox(height: 12), - if (order.status == 1 || order.status == 2) - InkWell( - onTap: () { - showConfirmMessage(model, order); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: Color(0xffD02127), - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(10), - ), - child: Text( - TranslationBase.of(context).cancel_nocaps, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), - ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), - ), + SizedBox(height: 12), + if (order.status == 1 || order.status == 2) + InkWell( + onTap: () { + showConfirmMessage(model, order); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: Color(0xffD02127), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(10), + ), + child: Text( + TranslationBase.of(context).cancel_nocaps, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), + ), + ), + ], + ), ], ), - ], - ), - ), - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.hhcAllPresOrders.length) : getNoDataWidget(context), + ), + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 12), + itemCount: model.hhcAllPresOrders.length) + : getNoDataWidget(context), ); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 33e874db..0197873b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -4,101 +4,101 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +// todo 'sikander' remove useless code // ignore: must_be_immutable -class ConfirmAddAmountDialog extends StatefulWidget { - final int amount; - final String unit; - final H2OViewModel model; - - ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); - - @override - _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); -} - -class _ConfirmAddAmountDialogState extends State { - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return SimpleDialog( - contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), - titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), - title: Center( - child: Texts( - TranslationBase.of(context).confirm, - textAlign: TextAlign.center, - color: Colors.black, - ), - ), - children: [ - Column( - children: [ - Divider(), - Center( - child: Texts( - "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", - textAlign: TextAlign.center, - color: Colors.grey, - ), - ), - SizedBox( - height: 16.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () async { - InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); - await widget.model.insertUserActivity(insertUserActivityRequestModel); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok.toUpperCase(), - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ), - ], - ) - ], - ); - } -} +// class ConfirmAddAmountDialog extends StatefulWidget { +// final int amount; +// final String unit; +// final H2OViewModel model; +// +// ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); +// +// @override +// _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); +// } +// +// class _ConfirmAddAmountDialogState extends State { +// @override +// void initState() { +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), +// titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), +// title: Center( +// child: Texts( +// TranslationBase.of(context).confirm, +// textAlign: TextAlign.center, +// color: Colors.black, +// ), +// ), +// children: [ +// Column( +// children: [ +// Divider(), +// Center( +// child: Texts( +// "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", +// textAlign: TextAlign.center, +// color: Colors.grey, +// ), +// ), +// SizedBox( +// height: 16.0, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel.toUpperCase(), +// color: Colors.red, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () async { +// InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); +// await widget.model.insertUserActivity(insertUserActivityRequestModel); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok.toUpperCase(), +// fontWeight: FontWeight.w400, +// )), +// ), +// ), +// ), +// ], +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index 2df90419..4d02c27b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -4,163 +4,163 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +// todo 'sikander' remove useless code // ignore: must_be_immutable -class SelectAmountDialog extends StatefulWidget { - final Function(AmountModel) onValueSelected; - AmountModel selectedAmount; - - SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); - - @override - _SelectAmountDialogState createState() => _SelectAmountDialogState(); -} - -class _SelectAmountDialogState extends State { - List searchAmount = [ - AmountModel(name: "l", nameAr: "لتر", value: 1), - AmountModel(name: "ml", nameAr: "مم لتر", value: 2), - ]; - @override - void initState() { - super.initState(); - widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; - getLanguage(); - } - - String languageID = "en"; - - void getLanguage() async { - languageID = await sharedPref.getString(APP_LANGUAGE); - setState(() {}); - } - - @override - Widget build(BuildContext context) { - return SimpleDialog( - children: [ - Column( - children: [ - Texts( - TranslationBase.of(context).preferredunit, - fontSize: 20, - ), - Divider(), - ...List.generate( - searchAmount.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.selectedAmount = searchAmount[index]; - }); - }, - child: ListTile( - title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), - leading: Radio( - value: searchAmount[index], - groupValue: widget.selectedAmount, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - widget.selectedAmount = value; - }); - }, - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - ], - ), - ), - SizedBox( - height: 5.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(widget.selectedAmount); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ) - ], - ) - ], - ); - } -} - -class AmountModel { - String name; - String nameAr; - int value; - - AmountModel({this.name, this.nameAr, this.value}); - - AmountModel.fromJson(Map json) { - name = json['name']; - nameAr = json['nameAr']; - value = json['value']; - } - - Map toJson() { - final Map data = new Map(); - data['name'] = this.name; - data['nameAr'] = this.nameAr; - data['value'] = this.value; - return data; - } -} +// class SelectAmountDialog extends StatefulWidget { +// final Function(AmountModel) onValueSelected; +// AmountModel selectedAmount; +// +// SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); +// +// @override +// _SelectAmountDialogState createState() => _SelectAmountDialogState(); +// } +// +// class _SelectAmountDialogState extends State { +// List searchAmount = [ +// AmountModel(name: "l", nameAr: "لتر", value: 1), +// AmountModel(name: "ml", nameAr: "مم لتر", value: 2), +// ]; +// @override +// void initState() { +// super.initState(); +// widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; +// getLanguage(); +// } +// +// String languageID = "en"; +// +// void getLanguage() async { +// languageID = await sharedPref.getString(APP_LANGUAGE); +// setState(() {}); +// } +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// children: [ +// Column( +// children: [ +// Texts( +// TranslationBase.of(context).preferredunit, +// fontSize: 20, +// ), +// Divider(), +// ...List.generate( +// searchAmount.length, +// (index) => Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// SizedBox( +// height: 2, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// setState(() { +// widget.selectedAmount = searchAmount[index]; +// }); +// }, +// child: ListTile( +// title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), +// leading: Radio( +// value: searchAmount[index], +// groupValue: widget.selectedAmount, +// activeColor: Colors.red[800], +// onChanged: (value) { +// setState(() { +// widget.selectedAmount = value; +// }); +// }, +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// ], +// ), +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel.toUpperCase(), +// color: Colors.red, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// widget.onValueSelected(widget.selectedAmount); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok, +// fontWeight: FontWeight.w400, +// )), +// ), +// ), +// ), +// ], +// ) +// ], +// ) +// ], +// ); +// } +// } +// +// class AmountModel { +// String name; +// String nameAr; +// int value; +// +// AmountModel({this.name, this.nameAr, this.value}); +// +// AmountModel.fromJson(Map json) { +// name = json['name']; +// nameAr = json['nameAr']; +// value = json['value']; +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['name'] = this.name; +// data['nameAr'] = this.nameAr; +// data['value'] = this.value; +// return data; +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart index 2b22a100..641f6df7 100644 --- a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -10,123 +10,124 @@ import 'package:flutter/material.dart'; import 'Dialog/select_amount_dialog.dart'; -class AddCustomAmount extends StatefulWidget { - final H2OViewModel model; - final Function changePageViewIndex; - - const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) - : super(key: key); - - @override - _AddCustomAmountState createState() => _AddCustomAmountState(); -} - -class _AddCustomAmountState extends State { - TextEditingController _nameTextController = TextEditingController(); - AmountModel selectedAmount; - - @override - void initState() { - setState(() { - _nameTextController.text = "0"; - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle:TranslationBase.of(context).customLabel, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).h2oAmountOfWater, - // type: "Number", - controller: _nameTextController, - ), - SizedBox( - height: 12, - ), - InkWell( - onTap: () => confirmAmountTypeDialog(), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getAmountName()), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - SizedBox( - height: 12, - ), - SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).ok, - onTap: () async { - Navigator.of(context).pop(); - showConfirmMessage (int.parse(_nameTextController.text), widget.model); - }, - // loading: model.state == ViewState.BusyLocal, - disabled: _nameTextController.text.isEmpty || selectedAmount == null), - SizedBox( - height: 12, - ), - ], - ), - ), - ), - ), - ), - ); - } - - -void confirmAmountTypeDialog() { - showDialog( - context: context, - child: SelectAmountDialog( - selectedAmount: selectedAmount, - onValueSelected: (value) { - setState(() { - selectedAmount = value; - }); - }, - ), - ); -} - - - String getAmountName() { - if (selectedAmount != null) - return selectedAmount.name; - else - return TranslationBase.of(context).selectUnit; - } - - - - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); - } -} +// todo 'sikander' remove useless code +// class AddCustomAmount extends StatefulWidget { +// final H2OViewModel model; +// final Function changePageViewIndex; +// +// const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) +// : super(key: key); +// +// @override +// _AddCustomAmountState createState() => _AddCustomAmountState(); +// } +// +// class _AddCustomAmountState extends State { +// TextEditingController _nameTextController = TextEditingController(); +// AmountModel selectedAmount; +// +// @override +// void initState() { +// setState(() { +// _nameTextController.text = "0"; +// }); +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: true, +// appBarTitle:TranslationBase.of(context).customLabel, +// body: SingleChildScrollView( +// physics: ScrollPhysics(), +// child: Container( +// margin: EdgeInsets.all(12), +// child: Center( +// child: FractionallySizedBox( +// widthFactor: 0.94, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// SizedBox( +// height: 12, +// ), +// NewTextFields( +// hintText: TranslationBase.of(context).h2oAmountOfWater, +// // type: "Number", +// controller: _nameTextController, +// ), +// SizedBox( +// height: 12, +// ), +// InkWell( +// onTap: () => confirmAmountTypeDialog(), +// child: Container( +// padding: EdgeInsets.all(12), +// width: double.infinity, +// height: 65, +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(12), +// color: Colors.white), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts(getAmountName()), +// Icon(Icons.arrow_drop_down) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 12, +// ), +// SecondaryButton( +// textColor: Colors.white, +// label: TranslationBase.of(context).ok, +// onTap: () async { +// Navigator.of(context).pop(); +// showConfirmMessage (int.parse(_nameTextController.text), widget.model); +// }, +// // loading: model.state == ViewState.BusyLocal, +// disabled: _nameTextController.text.isEmpty || selectedAmount == null), +// SizedBox( +// height: 12, +// ), +// ], +// ), +// ), +// ), +// ), +// ), +// ); +// } +// +// +// void confirmAmountTypeDialog() { +// showDialog( +// context: context, +// child: SelectAmountDialog( +// selectedAmount: selectedAmount, +// onValueSelected: (value) { +// setState(() { +// selectedAmount = value; +// }); +// }, +// ), +// ); +// } +// +// +// String getAmountName() { +// if (selectedAmount != null) +// return selectedAmount.name; +// else +// return TranslationBase.of(context).selectUnit; +// } +// +// +// +// void showConfirmMessage(int amount, H2OViewModel model) { +// showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 85c3544c..583dabbf 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -302,25 +302,11 @@ class _TodayPageState extends State { ); } - Widget _circularButton(context, int value, model, {bool isCustom = false}) { + Widget _circularButton(context, int value, model) { String _text = "$value${TranslationBase.of(context).ml}"; - if (isCustom) { - _text = TranslationBase.of(context).custom; - } return InkWell( onTap: () { - if (isCustom) { - Navigator.push( - context, - FadePage( - page: AddCustomAmount( - model: model, - ), - ), - ); - } else { - showConfirmMessage(context, value, model); - } + showConfirmMessage(context, value, model); }, child: Container( padding: EdgeInsets.all(21), diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 59a0a386..9b876cc1 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -9,189 +9,193 @@ import 'package:flutter/material.dart'; import '../add_custom_amount.dart'; -class H20FloatingActionButton extends StatefulWidget { - const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); - final H2OViewModel model; +// todo 'sikander' remove useless code - @override - _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); -} -class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { - AnimationController _controller; - @override - void initState() { - _controller = new AnimationController( - vsync: this, - duration: const Duration(milliseconds: 500), - ); - super.initState(); - } - - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog( - context: context, - child: ConfirmAddAmountDialog( - model: model, - amount: amount, - ), - ); - } - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 20, right: 20), - child: new Column(mainAxisSize: MainAxisSize.min, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ActionButton( - controller: _controller, - text: "600${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(600, widget.model); - }, - ), - ActionButton( - controller: _controller, - text: "330${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(330, widget.model); - }, - ), - ActionButton( - controller: _controller, - text: "200${TranslationBase.of(context).ml}", - onTap: () { - showConfirmMessage(200, widget.model); - }, - ), - ], - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - FloatingActionButton( - heroTag: null, - child: new AnimatedBuilder( - animation: _controller, - builder: (BuildContext context, Widget child) { - return new Transform( - transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), - alignment: FractionalOffset.center, - child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), - ); - }, - ), - onPressed: () { - if (_controller.isDismissed) { - _controller.forward(); - } else { - _controller.reverse(); - } - }, - ), - new Container( - margin: EdgeInsets.only(left: 8, bottom: 4), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - backgroundColor: Colors.white, - heroTag: null, - // mini: true, - child: Text( - TranslationBase.of(context).custom, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12, color: Colors.grey), - ), - onPressed: () { - Navigator.push( - context, - FadePage( - page: AddCustomAmount( - model: widget.model, - ), - ), - ); - }, - ), - ), - ), - new Container( - margin: EdgeInsets.only(left: 8, bottom: 4), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - backgroundColor: Colors.white, - heroTag: null, - //mini: true, - child: Text( - TranslationBase.of(context).undo, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12.0, color: Colors.grey), - ), - onPressed: undoVolume, - ), - ), - ), - ], - ), - ]), - ); - } - - void undoVolume() async { - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.undoUserActivity(); - GifLoaderDialogUtils.hideDialog(context); - } -} - -class ActionButton extends StatelessWidget { - const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) - : _controller = controller, - super(key: key); - - final AnimationController _controller; - final String text; - final Function onTap; - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 4, bottom: 8), - alignment: FractionalOffset.topCenter, - child: new ScaleTransition( - scale: new CurvedAnimation( - parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), - ), - child: new FloatingActionButton( - heroTag: null, - backgroundColor: Colors.white, - //mini: true, - child: Text( - text, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12.0, color: Colors.grey), - ), - onPressed: onTap), - ), - ); - } -} +// class H20FloatingActionButton extends StatefulWidget { +// const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); +// +// final H2OViewModel model; +// +// @override +// _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); +// } +// +// class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { +// AnimationController _controller; +// @override +// void initState() { +// _controller = new AnimationController( +// vsync: this, +// duration: const Duration(milliseconds: 500), +// ); +// super.initState(); +// } +// +// void showConfirmMessage(int amount, H2OViewModel model) { +// showDialog( +// context: context, +// child: ConfirmAddAmountDialog( +// model: model, +// amount: amount, +// ), +// ); +// } +// +// @override +// Widget build(BuildContext context) { +// return Container( +// margin: EdgeInsets.only(left: 20, right: 20), +// child: new Column(mainAxisSize: MainAxisSize.min, children: [ +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Column( +// crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// ActionButton( +// controller: _controller, +// text: "600${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(600, widget.model); +// }, +// ), +// ActionButton( +// controller: _controller, +// text: "330${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(330, widget.model); +// }, +// ), +// ActionButton( +// controller: _controller, +// text: "200${TranslationBase.of(context).ml}", +// onTap: () { +// showConfirmMessage(200, widget.model); +// }, +// ), +// ], +// ), +// ], +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// FloatingActionButton( +// heroTag: null, +// child: new AnimatedBuilder( +// animation: _controller, +// builder: (BuildContext context, Widget child) { +// return new Transform( +// transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), +// alignment: FractionalOffset.center, +// child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), +// ); +// }, +// ), +// onPressed: () { +// if (_controller.isDismissed) { +// _controller.forward(); +// } else { +// _controller.reverse(); +// } +// }, +// ), +// new Container( +// margin: EdgeInsets.only(left: 8, bottom: 4), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// backgroundColor: Colors.white, +// heroTag: null, +// // mini: true, +// child: Text( +// TranslationBase.of(context).custom, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12, color: Colors.grey), +// ), +// onPressed: () { +// Navigator.push( +// context, +// FadePage( +// page: AddCustomAmount( +// model: widget.model, +// ), +// ), +// ); +// }, +// ), +// ), +// ), +// new Container( +// margin: EdgeInsets.only(left: 8, bottom: 4), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// backgroundColor: Colors.white, +// heroTag: null, +// //mini: true, +// child: Text( +// TranslationBase.of(context).undo, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12.0, color: Colors.grey), +// ), +// onPressed: undoVolume, +// ), +// ), +// ), +// ], +// ), +// ]), +// ); +// } +// +// void undoVolume() async { +// GifLoaderDialogUtils.showMyDialog(context); +// await widget.model.undoUserActivity(); +// GifLoaderDialogUtils.hideDialog(context); +// } +// } +// +// class ActionButton extends StatelessWidget { +// const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) +// : _controller = controller, +// super(key: key); +// +// final AnimationController _controller; +// final String text; +// final Function onTap; +// +// @override +// Widget build(BuildContext context) { +// return Container( +// margin: EdgeInsets.only(left: 4, bottom: 8), +// alignment: FractionalOffset.topCenter, +// child: new ScaleTransition( +// scale: new CurvedAnimation( +// parent: _controller, +// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), +// ), +// child: new FloatingActionButton( +// heroTag: null, +// backgroundColor: Colors.white, +// //mini: true, +// child: Text( +// text, +// textAlign: TextAlign.center, +// style: TextStyle(fontSize: 12.0, color: Colors.grey), +// ), +// onPressed: onTap), +// ), +// ); +// } +// } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 1c861462..e3888240 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -96,8 +96,7 @@ class _BloodDonationPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).bloodDEnterDesc, - textAlign: TextAlign.center, + TranslationBase.of(context).bloodDEnterDesc ), SizedBox( height: 12, @@ -240,7 +239,8 @@ class _BloodDonationPageState extends State { ), bottomSheet: Container( width: double.infinity, - padding: EdgeInsets.all(12), + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(20), child: DefaultButton(TranslationBase.of(context).save, () async { if (_selectedHospital == null) { AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 2b49043e..e069eca6 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -401,7 +401,7 @@ class _BookConfirmState extends State { widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString(); }); - return widget.appoDateFormatted; + return DateUtil.getDayMonthYearDateFormatted(dateObj); } DateTime getDateTime() { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 84af56d6..15ccf128 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -214,55 +214,63 @@ class _BookSuccessState extends State { Widget _getConfirmAppoButtons() { return Container( - alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom: 5.0), - height: MediaQuery.of(context).size.height * 0.15, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare.toUpperCase() : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + color: CustomColors.appBackgroudGreyColor, + child: Container( + color: CustomColors.appBackgroudGreyColor, + margin: EdgeInsets.all(14), + height: 45.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: new Color(0xffc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 18.0)), + ), + ), ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: CustomColors.green, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, + style: TextStyle(fontSize: 18.0)), + ), + ), ), - ), - ], + ], + ), ), ); } @@ -365,11 +373,7 @@ class _BookSuccessState extends State { ), ], ), - // Container( - // margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - // child: Image.asset("assets/images/new-design/payment-method.png"), - // ), - Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -479,11 +483,9 @@ class _BookSuccessState extends State { appo.clinicID = widget.patientShareResponse.clinicID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd) { - setState(() {}); - } - ))).then((value) { + Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { + setState(() {}); + }))).then((value) { if (value != null) { openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index d1030636..ab36738e 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -224,7 +225,7 @@ class _SearchByClinicState extends State { child: Row( children: [ Checkbox( - activeColor: new Color(0xFF40ACC9), + activeColor: CustomColors.accentColor, value: nearestAppo, onChanged: (bool value) { setState(() { diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index 9d2ac0a5..2d7d5363 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class CovidPaymentAlert extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -126,7 +124,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate)), isBold: true, ), ], @@ -139,7 +137,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL", + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate), false), isBold: true, ), ], @@ -230,7 +228,6 @@ class _CovidPaymentAlertState extends State { }); } - Navigator.push( context, FadePage( diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index ee1398be..7633ab9c 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -51,12 +51,15 @@ class NotificationsDetailsPage extends StatelessWidget { ), Container( width: double.infinity, - color: Colors.grey[400], child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( + child: Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), - fontSize: 16, + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + fontWeight: FontWeight.w600 + ), ), ), ), @@ -88,7 +91,7 @@ class NotificationsDetailsPage extends StatelessWidget { children: [ Expanded( child: Center( - child: Texts(notification.message), + child: Text(notification.message), ), ), ], diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index aba2fb13..5a859fca 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -1,16 +1,17 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.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/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class NotificationsPage extends StatelessWidget { @@ -18,9 +19,7 @@ class NotificationsPage extends StatelessWidget { DateTime d = DateUtil.convertStringToDate(date); String monthName = DateUtil.getMonth(d.month).toString(); TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); - String minute = timeOfDay.minute < 10 - ? timeOfDay.minute.toString().padLeft(2, '0') - : timeOfDay.minute.toString(); + String minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString(); String hour = '${timeOfDay.hourOfPeriod}:$minute'; if (timeOfDay.period == DayPeriod.am) { @@ -39,112 +38,184 @@ class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) { - var prescriptionReport; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - GetNotificationsRequestModel getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); + GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); model.getNotifications(getNotificationsRequestModel, context); }, builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).notifications, - baseViewModel: model, - body: ListView( - children: model.notifications - .map( - (notification) => InkWell( - onTap: () async { - if (!notification.isRead) { - model.markAsRead(notification.id); - } - Navigator.push( - context, - FadePage( - page: NotificationsDetailsPage( - notification: notification, - ))); - }, - child: Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 5, left: 10, right: 10, bottom: 5), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: notification.isRead - ? Colors.grey[200] - : CustomColors.accentColor, - width: 0.5), - ), - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: Texts(notification.message)), - if (notification.messageType == "image") - Icon(FontAwesomeIcons.images) - ], - ), - SizedBox( - height: 5, - ), - ], + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).notifications, + baseViewModel: model, + body: ListView.separated( + itemBuilder: (context, index) { + return InkWell( + onTap: () async { + if (!model.notifications[index].isRead) { + model.markAsRead(model.notifications[index].id); + } + Navigator.push( + context, + FadePage( + page: NotificationsDetailsPage( + notification: model.notifications[index], + ))); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + border: projectViewModel.isArabic + ? Border( + right: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, + ), + ) + : Border( + left: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, ), ), + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + " " + + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded(child: Texts(model.notifications[index].message)), + if (model.notifications[index].messageType == "image") + Icon( + FontAwesomeIcons.images, + color: CustomColors.grey, + ) + ], + ), + SizedBox( + height: 5, + ), + ], + ), ), - SizedBox( - width: 15, - ), - ], - ), + ), + ], ), ), - ) - .toList() - ..add( - InkWell( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - currentIndex++; - GetNotificationsRequestModel - getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); - - await model.getNotifications( - getNotificationsRequestModel, context); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Image.asset('assets/images/notf.png'), - ), + ); + }, + separatorBuilder: (context, index) { + return Column( + children: [ + Divider( + color: Colors.grey[300], + thickness: 2.0, ), - )), - ), + ], + ); + }, + itemCount: model.notifications.length)), + // ListView( + // children: model.notifications + // .map( + // (notification) => InkWell( + // onTap: () async { + // if (!notification.isRead) { + // model.markAsRead(notification.id); + // } + // Navigator.push( + // context, + // FadePage( + // page: NotificationsDetailsPage( + // notification: notification, + // ))); + // }, + // child: Container( + // width: double.infinity, + // padding: EdgeInsets.all(8.0), + // decoration: BoxDecoration( + // color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05), + // border: Border( + // left: BorderSide( + // color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor, + // width: 5.0, + // ), + // ), + // ), + // child: Row( + // children: [ + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // Expanded( + // child: Texts(notification.message)), + // if (notification.messageType == "image") + // Icon(FontAwesomeIcons.images, color: CustomColors.grey,) + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Divider( + // height: 5.0, + // color: CustomColors.grey2, + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ) + // .toList() + // ..add( + // InkWell( + // onTap: () async { + // GifLoaderDialogUtils.showMyDialog(context); + // currentIndex++; + // GetNotificationsRequestModel + // getNotificationsRequestModel = + // new GetNotificationsRequestModel( + // currentPage: currentIndex, + // pagingSize: 14, + // notificationStatusID: 2); + // + // await model.getNotifications( + // getNotificationsRequestModel, context); + // GifLoaderDialogUtils.hideDialog(context); + // }, + // child: Center( + // child: Image.asset('assets/images/notf.png'), + // ), + // ), + // )), ); } } diff --git a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart index 1144e587..b31d4a38 100644 --- a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart +++ b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart @@ -2,75 +2,75 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - -class ConfirmExitPageDialog extends StatelessWidget { - final GestureTapCallback onTapYes; - final GestureTapCallback onTapNo; - - const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return SimpleDialog( - contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), - title: Center( - child: Texts( - TranslationBase.of(context).confirm, - color: Colors.black, - ), - ), - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts( - "Are you sure you want to exit this page ?", - color: Colors.grey, - ), - SizedBox( - height: 5, - ), - Divider(), - SizedBox( - height: 5.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: () { - onTapNo(); - }, - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).no, - color: Colors.red, - ), - ), - ), - ), - - InkWell( - onTap: () { - Navigator.pop(context); - onTapYes(); - }, - child: Container( - child: Center( - child: Texts(TranslationBase.of(context).yes), - ), - ), - ), - ], - ), - SizedBox( - height: 20.0, - ), - ], - ) - ], - ); - } -} +// todo 'sikander' remove useless code +// class ConfirmExitPageDialog extends StatelessWidget { +// final GestureTapCallback onTapYes; +// final GestureTapCallback onTapNo; +// +// const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) +// : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// return SimpleDialog( +// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), +// title: Center( +// child: Texts( +// TranslationBase.of(context).confirm, +// color: Colors.black, +// ), +// ), +// children: [ +// Column( +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Texts( +// "Are you sure you want to exit this page ?", +// color: Colors.grey, +// ), +// SizedBox( +// height: 5, +// ), +// Divider(), +// SizedBox( +// height: 5.0, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// InkWell( +// onTap: () { +// onTapNo(); +// }, +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).no, +// color: Colors.red, +// ), +// ), +// ), +// ), +// +// InkWell( +// onTap: () { +// Navigator.pop(context); +// onTapYes(); +// }, +// child: Container( +// child: Center( +// child: Texts(TranslationBase.of(context).yes), +// ), +// ), +// ), +// ], +// ), +// SizedBox( +// height: 20.0, +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index edab81c1..457e199c 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -30,14 +30,12 @@ class _DdServicesPageState extends State { void initState() { super.initState(); pageController = new PageController(); - } _changePageViewIndex(int tab) { setState(() { pageController.jumpToPage(tab); - pageController.animateToPage(tab, - duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); }); } @@ -99,25 +97,28 @@ class _DdServicesPageState extends State { selectedQuestions: selectedQuestions, triageInformationRequest: triageInformationRequest, ), - EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,) + EdPaymentInformationPage( + selectedHospital: triageInformationRequest.selectedHospital, + ) ], ), ); } - void showConfirmMessage( - BuildContext context, - ) { - showDialog( - context: context, - child: ConfirmExitPageDialog( - onTapYes: () { - Navigator.pop(context); - }, - onTapNo: () { - Navigator.pop(context); - }, - ), - ); - } + // todo 'sikander' remove useless code + // void showConfirmMessage( + // BuildContext context, + // ) { + // showDialog( + // context: context, + // child: ConfirmExitPageDialog( + // onTapYes: () { + // Navigator.pop(context); + // }, + // onTapNo: () { + // Navigator.pop(context); + // }, + // ), + // ); + // } } diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index c46535b3..7c1bf6ed 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -4,7 +4,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class PaymentDialog extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -30,25 +32,18 @@ class _PaymentDialogState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Container( margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)), - ), - Divider( - color: Colors.grey, + child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).appoDetails, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), + child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.grey[700], fontSize: 15.0, fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(widget.appo.projectName, style: getTextStyle()), ), Divider( @@ -58,7 +53,7 @@ class _PaymentDialogState extends State { margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), child: Table( children: [ - TableRow(children: [ + TableRow(decoration: BoxDecoration(), children: [ TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), ]), @@ -77,46 +72,38 @@ class _PaymentDialogState extends State { color: Colors.grey, ), Container( - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)), ), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 15.0), - child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor)), - ), - Divider( - color: Colors.grey, + margin: EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 15.0), + child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600)), ), Container( alignment: Alignment.center, height: 40.0, + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), child: Flex( direction: Axis.horizontal, children: [ Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).cancel, + () { Navigator.pop(context, null); }, - child: Container( - child: Text(TranslationBase.of(context).cancel, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, color: CustomColors.accentColor)), - ), + color: Color(0xffEAEAEA), + textColor: Colors.black, ), ), + mWidth(10.0), Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).confirm, + () { Navigator.pop(context, widget.patientShareResponse); -// widget.onPaymentMethodSelected(); }, - child: Container( - child: Text(TranslationBase.of(context).ok, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - )), - ), ), ), ], @@ -131,28 +118,17 @@ class _PaymentDialogState extends State { _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0), - child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), + child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.black)), ); } TextStyle getTextStyle() { - return TextStyle(color: Colors.grey[700], fontSize: 13.0); + return TextStyle(color: Colors.grey[700], fontSize: 13.0, fontWeight: FontWeight.w600); } -// Future navigateToPaymentMethod(context) async { -// Navigator.push( -// context, MaterialPageRoute(builder: (context) => PaymentMethod())); -// } - String getDate(String date) { DateTime dateObj = DateUtil.convertStringToDate(date); - return DateUtil.getWeekDay(dateObj.weekday) + - ", " + - dateObj.day.toString() + - " " + - DateUtil.getMonth(dateObj.month) + - " " + - dateObj.year.toString() + + return DateUtil.getDayMonthYearDateFormatted(dateObj) + " " + dateObj.hour.toString() + ":" + diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index a95fb425..dc1b47f7 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; @@ -50,6 +51,7 @@ class _SendFeedbackPageState extends State { var _currentLocaleId; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; + int selectedStatusIndex = 5; var event = RobotProvider(); List appoList = []; @@ -165,16 +167,16 @@ class _SendFeedbackPageState extends State { }); }, child: DoctorCard( - onTap: null, - isInOutPatient: appointHistory.isInOutPatient, - name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, - // billNo: _appointmentResult.invoiceNo, - profileUrl: appointHistory.doctorImageURL, - subName: appointHistory.projectName, - isLiveCareAppointment: appointHistory.isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointHistory.appointmentDate), - rating: appointHistory.actualDoctorRate + 0.0, - appointmentTime: appointHistory.startTime.substring(0, 5), + onTap: null, + isInOutPatient: appointHistory.isInOutPatient, + name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: appointHistory.doctorImageURL, + subName: appointHistory.projectName, + isLiveCareAppointment: appointHistory.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory.appointmentDate), + rating: appointHistory.actualDoctorRate + 0.0, + appointmentTime: appointHistory.startTime.substring(0, 5), ), ), SizedBox(height: 12), @@ -182,8 +184,9 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(bottom: 10.0), height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, - child: ListView.builder( + child: ListView.separated( itemCount: appoList.length, + separatorBuilder: (ctx, index) => SizedBox(height: 12), itemBuilder: (context, index) => InkWell( onTap: () { setState(() { @@ -309,6 +312,7 @@ class _SendFeedbackPageState extends State { messageController.text = ""; images = []; }); + selectedStatusIndex = 5; setMessageType(MessageType.NON); GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); @@ -429,42 +433,107 @@ class _SendFeedbackPageState extends State { // Show Dialog function void confirmBox(FeedbackViewModel model) { DoctorsListService service = new DoctorsListService(); + + List list = [ + RadioSelectionDialogModel(TranslationBase.of(context).notClassified, 5), + RadioSelectionDialogModel(TranslationBase.of(context).complainAppo, 1), + RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 2), + RadioSelectionDialogModel(TranslationBase.of(context).question, 3), + RadioSelectionDialogModel(TranslationBase.of(context).compliment, 4), + RadioSelectionDialogModel(TranslationBase.of(context).suggestion, 6), + ]; + showDialog( - context: context, - child: FeedbackTypeDialog( - messageTypeDialog: messageType, - onValueSelected: (MessageType value) { - if (value == MessageType.ComplaintOnAnAppointment) { - appoList.clear(); - GifLoaderDialogUtils.showMyDialog(context); - service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - if (res['MessageStatus'] == 1) { - if (res['AppoimentAllHistoryResultList'].length != 0) { - res['AppoimentAllHistoryResultList'].forEach((v) { - appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - setState(() { - appointHistory = null; - isShowListAppointHistory = true; - }); - } else {} - } else { - } - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - // print(err); - // AppToast.showErrorToast(message: err); - // Navigator.of(context).pop(); + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: selectedStatusIndex, + onValueSelected: (index) { + selectedStatusIndex = index; + + if (index == 1) { + messageType = MessageType.ComplaintOnAnAppointment; + } else if (index == 2) { + messageType = MessageType.ComplaintWithoutAppointment; + } else if (index == 3) { + messageType = MessageType.Question; + } else if (index == 4) { + messageType = MessageType.Compliment; + } else if (index == 5) { + messageType = MessageType.NON; + } else { + messageType = MessageType.Suggestion; + } + + if (messageType == MessageType.ComplaintOnAnAppointment) { + appoList.clear(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + if (res['AppoimentAllHistoryResultList'].length != 0) { + res['AppoimentAllHistoryResultList'].forEach((v) { + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + setState(() { + appointHistory = null; + isShowListAppointHistory = true; + }); + } else {} + } else {} }); - } else { - isShowListAppointHistory = false; - } - setMessageType(value); - }, - )); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + // print(err); + // AppToast.showErrorToast(message: err); + // Navigator.of(context).pop(); + }); + } else { + isShowListAppointHistory = false; + } + setMessageType(messageType); + }, + ), + ); + + return; + // todo 'sikander' remove useless code + // showDialog( + // context: context, + // child: FeedbackTypeDialog( + // messageTypeDialog: messageType, + // onValueSelected: (MessageType value) { + // if (value == MessageType.ComplaintOnAnAppointment) { + // appoList.clear(); + // GifLoaderDialogUtils.showMyDialog(context); + // service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + // GifLoaderDialogUtils.hideDialog(context); + // setState(() { + // if (res['MessageStatus'] == 1) { + // if (res['AppoimentAllHistoryResultList'].length != 0) { + // res['AppoimentAllHistoryResultList'].forEach((v) { + // appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + // }); + // setState(() { + // appointHistory = null; + // isShowListAppointHistory = true; + // }); + // } else {} + // } else {} + // }); + // }).catchError((err) { + // GifLoaderDialogUtils.hideDialog(context); + // // print(err); + // // AppToast.showErrorToast(message: err); + // // Navigator.of(context).pop(); + // }); + // } else { + // isShowListAppointHistory = false; + // } + // setMessageType(value); + // }, + // )); } openSpeechReco() async { @@ -518,238 +587,238 @@ class _SendFeedbackPageState extends State { if (!mounted) return; } } - -class FeedbackTypeDialog extends StatefulWidget { - final Function(MessageType) onValueSelected; - final MessageType messageTypeDialog; - - const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); - - @override - State createState() => new FeedbackTypeDialogState(); -} - -class FeedbackTypeDialogState extends State { - MessageType messageTypeDialog = MessageType.NON; - - setMessageDialogType(MessageType messageType) { - setState(() { - messageTypeDialog = messageType; - }); - } - - @override - void initState() { - messageTypeDialog = widget.messageTypeDialog; - - super.initState(); - } - - Widget build(BuildContext context) { - return BaseView( - builder: (_, model, widge) => SimpleDialog( - title: Text( - TranslationBase.of(context).messageType, - textAlign: TextAlign.center, - ), - children: [ - Container( - // padding: const EdgeInsets.all(10.0), - child: Column( - children: [ - Divider( - height: 2.5, - color: Colors.grey[500], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.NON), - child: ListTile( - title: Texts(TranslationBase.of(context).notClassified), - leading: Radio( - value: MessageType.NON, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), - child: ListTile( - title: Texts(TranslationBase.of(context).complainAppo), - leading: Radio( - value: MessageType.ComplaintOnAnAppointment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), - child: ListTile( - title: Texts(TranslationBase.of(context).complainWithoutAppo), - leading: Radio( - value: MessageType.ComplaintWithoutAppointment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Question), - child: ListTile( - title: Texts(TranslationBase.of(context).question), - leading: Radio( - value: MessageType.Question, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Compliment), - child: ListTile( - title: Texts(TranslationBase.of(context).compliment), - leading: Radio( - value: MessageType.Compliment, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => setMessageDialogType(MessageType.Suggestion), - child: ListTile( - title: Texts(TranslationBase.of(context).suggestion), - leading: Radio( - value: MessageType.Suggestion, - groupValue: messageTypeDialog, - activeColor: CustomColors.accentColor, - onChanged: (MessageType value) => setMessageDialogType(value), - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - Divider( - height: 2.5, - color: Colors.grey[500], - ), - SizedBox( - height: 5, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel, - color: CustomColors.accentColor, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(messageTypeDialog); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - )), - ], - ) - ], - ), - ), - ], - ), - ); - } -} +// todo 'sikander' remove useless code +// class FeedbackTypeDialog extends StatefulWidget { +// final Function(MessageType) onValueSelected; +// final MessageType messageTypeDialog; +// +// const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); +// +// @override +// State createState() => new FeedbackTypeDialogState(); +// } +// +// class FeedbackTypeDialogState extends State { +// MessageType messageTypeDialog = MessageType.NON; +// +// setMessageDialogType(MessageType messageType) { +// setState(() { +// messageTypeDialog = messageType; +// }); +// } +// +// @override +// void initState() { +// messageTypeDialog = widget.messageTypeDialog; +// +// super.initState(); +// } +// +// Widget build(BuildContext context) { +// return BaseView( +// builder: (_, model, widge) => SimpleDialog( +// title: Text( +// TranslationBase.of(context).messageType, +// textAlign: TextAlign.center, +// ), +// children: [ +// Container( +// // padding: const EdgeInsets.all(10.0), +// child: Column( +// children: [ +// Divider( +// height: 2.5, +// color: Colors.grey[500], +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.NON), +// child: ListTile( +// title: Texts(TranslationBase.of(context).notClassified), +// leading: Radio( +// value: MessageType.NON, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).complainAppo), +// leading: Radio( +// value: MessageType.ComplaintOnAnAppointment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).complainWithoutAppo), +// leading: Radio( +// value: MessageType.ComplaintWithoutAppointment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Question), +// child: ListTile( +// title: Texts(TranslationBase.of(context).question), +// leading: Radio( +// value: MessageType.Question, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Compliment), +// child: ListTile( +// title: Texts(TranslationBase.of(context).compliment), +// leading: Radio( +// value: MessageType.Compliment, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Row( +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () => setMessageDialogType(MessageType.Suggestion), +// child: ListTile( +// title: Texts(TranslationBase.of(context).suggestion), +// leading: Radio( +// value: MessageType.Suggestion, +// groupValue: messageTypeDialog, +// activeColor: CustomColors.accentColor, +// onChanged: (MessageType value) => setMessageDialogType(value), +// ), +// ), +// ), +// ) +// ], +// ), +// SizedBox( +// height: 5.0, +// ), +// Divider( +// height: 2.5, +// color: Colors.grey[500], +// ), +// SizedBox( +// height: 5, +// ), +// Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// Navigator.pop(context); +// }, +// child: Padding( +// padding: EdgeInsets.all(8.0), +// child: Container( +// child: Center( +// child: Texts( +// TranslationBase.of(context).cancel, +// color: CustomColors.accentColor, +// ), +// ), +// ), +// ), +// ), +// ), +// Container( +// width: 1, +// height: 30, +// color: Colors.grey[500], +// ), +// Expanded( +// flex: 1, +// child: InkWell( +// onTap: () { +// widget.onValueSelected(messageTypeDialog); +// Navigator.pop(context); +// }, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Texts( +// TranslationBase.of(context).ok, +// fontWeight: FontWeight.w400, +// )), +// ), +// )), +// ], +// ) +// ], +// ), +// ), +// ], +// ), +// ); +// } +// } diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 269b336d..46a545a6 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -42,7 +42,7 @@ class _StatusFeedbackPageState extends State { children: [ Expanded( child: projectViewModel.isLogin - ? !model.cOCItemList.isNotEmpty + ? model.cOCItemList.isNotEmpty ? listData(model.cOCItemList, projectViewModel.isArabic, true) : Center( child: Column( diff --git a/lib/pages/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart index 2cc381d4..a1be5cf8 100644 --- a/lib/pages/insurance/insurance_approval_detail_screen.dart +++ b/lib/pages/insurance/insurance_approval_detail_screen.dart @@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget { myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), SizedBox(height: 6), myRichText(TranslationBase.of(context).receiptOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "", projectViewModel.isArabic), myRichText(TranslationBase.of(context).expiryOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "", projectViewModel.isArabic), ], ), ), @@ -101,8 +101,8 @@ class InsuranceApprovalDetail extends StatelessWidget { TableRow( children: [ Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.approvalStatusDescption ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.status ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc ?? '', isLast: true, mProjectViewModel: projectViewModel), ], ), ]) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 13cc2dce..120428c4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -173,19 +173,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { // pageController.jumpToPage(tab); } else { - if (currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) { pageController.jumpToPage(0); - else if (tab != 0) { + currentTab = tab; + } else if (tab != 0) { if (tab == 4 && projectViewModel.isLogin && model.count == 0) { AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); } else { pageController.jumpToPage(tab); + currentTab = tab; } } else { pageController.jumpToPage(tab); + currentTab = tab; } - currentTab = tab; + // currentTab = tab; } }); } @@ -385,11 +388,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } - showDialogs(String message) { - ConfirmDialog dialog = new ConfirmDialog( - context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); - dialog.showAlertDialog(context); - } + // todo 'sikander' remove useless code + // showDialogs(String message) { + // ConfirmDialog dialog = new ConfirmDialog( + // context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); + // dialog.showAlertDialog(context); + // } Future> requestPermissions() async { var permissionResults = [ diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 785fcb71..d3029f86 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; 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/dialogs/confirm_dialog.dart'; @@ -60,7 +61,7 @@ class _LiveCareHistoryCardState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)), + Text(DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), style: TextStyle(fontSize: 14.0)), Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])), ], ), @@ -130,8 +131,8 @@ class _LiveCareHistoryCardState extends State { Icon(Icons.star, size: 24.0, color: Colors.yellow[700]), Container( width: MediaQuery.of(context).size.width * 0.2, - margin: EdgeInsets.only(left: 10.0), - child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), + margin: EdgeInsets.only(left: 9.0), + child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 11.0)), ), ], ), diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index 7605a879..fd47ea1b 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -50,7 +50,7 @@ class _SelectHospitalDialogState extends State { }, child: ListTile( title: Text( - widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM', + widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 0f35a96f..9a6a9b03 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart'; import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,15 +10,11 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/extensions/list_extension.dart'; class InvoiceDetail extends StatefulWidget { final DoctorList doctor; @@ -73,7 +68,8 @@ class _InvoiceDetailState extends State { widget.doctor.doctorRate, widget.doctor.actualDoctorRate, widget.doctor.noOfPatientsRate ?? 0, - projectViewModel.user.emailAddress), + projectViewModel.user.emailAddress, + decimalDoctorRate: widget.doctor.decimalDoctorRate.toString()), onTap: () { sendInvoiceEmail(); }, @@ -117,7 +113,12 @@ class _InvoiceDetailState extends State { margin: EdgeInsets.only(bottom: 10.0), child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)), ), - myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic), + myRichText( + TranslationBase.of(context).insuranceCompany + ": ", + projectViewModel.isArabic + ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].groupNameN + : widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, + projectViewModel.isArabic), myRichText( TranslationBase.of(context).insuranceID + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A", diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index d13a0599..820bf355 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -97,6 +97,10 @@ class _MyInvoicesState extends State { doctor.dayName = listDentalAppointments.invoiceNo; doctor.clinicName = listDentalAppointments.invoiceNo.toString(); doctor.date = listDentalAppointments.appointmentDate; + doctor.noOfPatientsRate = listDentalAppointments.patientNumber; + doctor.actualDoctorRate = listDentalAppointments.doctorRate; + doctor.decimalDoctorRate = listDentalAppointments.decimalDoctorRate; + doctor.doctorID = listDentalAppointments.doctorID; myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart index 5380896e..7c96dc3e 100644 --- a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -8,8 +8,10 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -35,12 +37,15 @@ class _AddWeightPageState extends State { TextEditingController _weightValueController = TextEditingController(); DateTime dayWeightDate = DateTime.now(); DateTime timeWeightDate = DateTime.now(); - int weightUnit = 1; + int weightUnit = 0; final List measureUnitEnList = [ - 'Kg', 'Pound', + 'Kg', + ]; + final List measureUnitArList = [ + "باوند", + "كيلو جرام", ]; - final List measureUnitArList = ["كيلو جرام", "باوند"]; String measureTimeSelectedType; bool isButtonDisabled = true; @@ -52,9 +57,6 @@ class _AddWeightPageState extends State { timeWeightDate = widget.dayWeightDate; measureTimeSelectedType = widget.measureTimeSelectedType; weightUnit = widget.weightUnit; - // if (measureUnitEnList.contains(widget.measureTimeSelectedType)) - // weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); - // else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType); _weightValueController.text = widget.weightValue; validateForm(); } @@ -65,19 +67,17 @@ class _AddWeightPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowAppBar: true, - appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - showNewAppBar: true, - showNewAppBarTitle: true, - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( + isShowAppBar: true, + appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, + showNewAppBar: true, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), children: [ - SizedBox( - height: 15, - ), NewTextFields( hintText: TranslationBase.of(context).weightAdd, controller: _weightValueController, @@ -86,12 +86,27 @@ class _AddWeightPageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureUnitArList : measureUnitEnList); + List list = [ + RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[0] : measureUnitEnList[0], 0), + RadioSelectionDialogModel(projectViewModel.isArabic ? measureUnitArList[1] : measureUnitEnList[1], 1), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: weightUnit, + onValueSelected: (index) { + weightUnit = index; + measureTimeSelectedType = list[index].title; + setState(() {}); + validateForm(); + }, + ), + ); }, child: Container( padding: EdgeInsets.all(12), @@ -110,9 +125,7 @@ class _AddWeightPageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showDatePicker( @@ -143,9 +156,7 @@ class _AddWeightPageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showTimePicker( @@ -185,6 +196,28 @@ class _AddWeightPageState extends State { color: Colors.red[900], ), onTap: () { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).removeMeasure, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.ErrorLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + }, + ), + ); + return; + + // todo 'sikander' remove useless code ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).removeMeasure, @@ -209,55 +242,58 @@ class _AddWeightPageState extends State { dialog.showAlertDialog(context); }) ], - )) + ), + ) : Container() ], ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(20.0), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).save.toUpperCase(), - isButtonDisabled ? null : () async { - if (_weightValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - if (widget.isUpdate) { - widget.model - .updateWeightResult( + isButtonDisabled + ? null + : () async { + if (_weightValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + if (widget.isUpdate) { + widget.model + .updateWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } else + widget.model + .addWeightResult( weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit + 1, - lineItemNo: widget.lineItemNo) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } else - widget.model - .addWeightResult( - weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', - weightMeasured: _weightValueController.text.toString(), - weightUnit: weightUnit, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.Error) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - }); - } - }, + weightUnit: weightUnit, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } + }, disabledColor: Colors.grey, ), - ), - )); + ) + ], + ), + ); } String getDate() { diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index ff5a707d..3cc02dba 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -8,12 +7,10 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; -import 'package:diplomaticquarterapp/widgets/charts/show_chart.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 WeightMonthlyPage extends StatelessWidget { final WeightPressureViewModel model; @@ -26,7 +23,6 @@ class WeightMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -43,7 +39,6 @@ class WeightMonthlyPage extends StatelessWidget { timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData, indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, ), - ), Card( shape: cardRadius(12), @@ -81,7 +76,7 @@ class WeightMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(2.5), // 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]) @@ -97,7 +92,7 @@ class WeightMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -113,8 +108,7 @@ class WeightMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), ], diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 54891563..6725874f 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -12,7 +11,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'AddWeightPage.dart'; @@ -23,23 +21,11 @@ class WeightWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( isShowDecPage: false, backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - // Container( - // margin: EdgeInsets.only(top: 12, left: 8, right: 8), - // color: Colors.white, - // child: LineChartCurved( - // horizontalInterval: 1.0, - // title: TranslationBase.of(context).weight, - // timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData, - // indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, - // ), - // ), Card( shape: cardRadius(12), elevation: 1, @@ -78,7 +64,7 @@ class WeightWeeklyPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), ], ), @@ -92,7 +78,7 @@ class WeightWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -109,8 +95,7 @@ class WeightWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index efa3393d..c0c2142b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -25,7 +25,6 @@ class WeightYearPage extends StatelessWidget { List monthlyGroup = []; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -76,7 +75,7 @@ class WeightYearPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -91,7 +90,7 @@ class WeightYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -107,7 +106,7 @@ class WeightYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 44a28209..77bb45b7 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -40,13 +41,10 @@ class _AddBloodPressurePageState extends State { TextEditingController _bloodDiastolicValueController = TextEditingController(); DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); - int measuredArm = 1; + int measuredArm = 0; bool isButtonDisabled = true; - final List measureTimeEnList = ['Right Arm', 'Left Arm']; - final List measureTimeArList = [ - 'الذراع الأيمن', - 'الذراع الأيسر', - ]; + final List measureTimeEnList = ['Left Arm', 'Right Arm']; + final List measureTimeArList = ['الذراع الأيسر', 'الذراع الأيمن']; String measureTimeSelectedType = 'Left Arm'; @override @@ -56,7 +54,9 @@ class _AddBloodPressurePageState extends State { bloodSugarDate = widget.bloodSugarDate; bloodSugarDate = widget.bloodSugarDate; measureTimeSelectedType = widget.measureTimeSelectedType; - measuredArm = widget.measuredArm - 1; + measuredArm = widget.measuredArm; + if (measuredArm > 1) measuredArm = measuredArm - 1; + _bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue; validateForm(); @@ -68,19 +68,17 @@ class _AddBloodPressurePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - isShowAppBar: true, - appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - showNewAppBar: true, - showNewAppBarTitle: true, - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( + isShowAppBar: true, + appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, + showNewAppBar: true, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), children: [ - SizedBox( - height: 15, - ), NewTextFields( hintText: TranslationBase.of(context).systolicAdd, controller: _bloodSystolicValueController, @@ -90,9 +88,7 @@ class _AddBloodPressurePageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), NewTextFields( hintText: TranslationBase.of(context).diastolicAdd, controller: _bloodDiastolicValueController, @@ -102,11 +98,29 @@ class _AddBloodPressurePageState extends State { fontWeight: FontWeight.normal, fontSize: 14, ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { + List list = [ + RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[0] : measureTimeEnList[0], 0), + RadioSelectionDialogModel(projectViewModel.isArabic ? measureTimeArList[1] : measureTimeEnList[1], 1), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: measuredArm, + onValueSelected: (index) { + measuredArm = index; + measureTimeSelectedType = list[index].title; + setState(() {}); + validateForm(); + }, + ), + ); + return; + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); }, child: Container( @@ -126,9 +140,7 @@ class _AddBloodPressurePageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { @@ -153,9 +165,7 @@ class _AddBloodPressurePageState extends State { ), ), ), - SizedBox( - height: 8, - ), + SizedBox(height: 12), InkWell( onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { @@ -220,41 +230,43 @@ class _AddBloodPressurePageState extends State { ], ), ), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(20.0), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).save, - isButtonDisabled ? null : () async { - if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: (measuredArm + 1), - lineItemNo: widget.lineItemNo) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }, + isButtonDisabled + ? null + : () async { + if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: (measuredArm), + lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + } + }, disabledColor: Colors.grey, ), - ), - )); + ) + ], + ), + ); } String getDate() { diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index a99b75ea..d0a68588 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -44,113 +44,101 @@ class _BloodPressureHomePageState extends State with Sing ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getBloodPressure(), - builder: (_, model, w) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase - .of(context) - .bloodPressure, - showNewAppBar: true, - showNewAppBarTitle: true, - baseViewModel: model, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: TabBarWidget( - tabController: _tabController, - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - BloodPressureWeeklyPage( - model: model, - ), - BloodPressureMonthlyPage( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).bloodPressure, + showNewAppBar: true, + showNewAppBarTitle: true, + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: TabBarWidget( + tabController: _tabController, + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + model: model, + ), + BloodPressureMonthlyPage( + model: model, + ), + BloodPressureYearPage( + model: model, + ) + ], + ), + ) + ], + ), + floatingActionButton: Stack(children: [ + Positioned( + bottom: 60, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddBloodPressurePage( model: model, + ))).then((value) { + model.getBloodPressure(); + }); + }, + child: Container( + width: 50, + height: 50, + decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), - BloodPressureYearPage( - model: model, - ) - ], - ), - ) - ], - ), - floatingActionButton: Stack(children: [ - Positioned( - bottom: 60, - right: projectViewModel.isArabic ? MediaQuery - .of(context) - .size - .width * .85 : 0, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddBloodPressurePage( - model: model, - ))).then((value) { - model.getBloodPressure(); + )), + )) + ]), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).sendEmail, + () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async { + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).emailSentSuccessfully, + ); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); }); }, - child: Container( - width: 50, - height: 50, - decoration: BoxDecoration(shape: BoxShape.circle, color: Theme - .of(context) - .primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), - )), - )) - ]), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Padding( - padding: const EdgeInsets.all(12.0), - child: DefaultButton( - TranslationBase - .of(context) - .sendEmail, - () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: model.user.emailAddress, - onTapSendEmail: () async { - GifLoaderDialogUtils.showMyDialog(context); - model.sendReportByEmail().then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - AppToast.showErrorToast(message: model.error); - } else { - AppToast.showSuccessToast( - message: TranslationBase - .of(context) - .emailSentSuccessfully, - ); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: model.error); - }); - }, - ), - ); - }, - // label: TranslationBase.of(context).sendEmail, - // backgroundColor: Colors.red[900], - ), - ), + ), + ); + }, + // label: TranslationBase.of(context).sendEmail, + // backgroundColor: Colors.red[900], ), - )), + ), + ), + )), ); } } diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index 8f79bb34..049636a9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ 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 BloodPressureMonthlyPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -67,7 +65,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +78,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +95,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index c31b5f5c..1b1334e9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ 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 BloodPressureYearPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureYearPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -28,7 +26,8 @@ class BloodPressureYearPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, child: CurvedChartBloodPressure( - horizontalInterval: 3.0, // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, + horizontalInterval: 3.0, + // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataTop, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataLow, @@ -38,10 +37,6 @@ class BloodPressureYearPage extends StatelessWidget { SizedBox( height: 12, ), - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Texts(TranslationBase.of(context).details), - // ), Container( padding: EdgeInsets.all(10), color: Colors.transparent, @@ -67,7 +62,7 @@ class BloodPressureYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +75,7 @@ class BloodPressureYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +92,7 @@ class BloodPressureYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 1e7f3b8b..f3bdb057 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -1,16 +1,15 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; + import 'AddBloodPressurePage.dart'; class BloodPressureWeeklyPage extends StatelessWidget { @@ -20,7 +19,6 @@ class BloodPressureWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -28,8 +26,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 12.0), padding: EdgeInsets.only(bottom: 12.0), color: Colors.white, - child: CurvedChartBloodPressure( - horizontalInterval: 3.0, + child: LineChartCurvedBloodPressure( title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, @@ -60,7 +57,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), SizedBox(height: 80) ], @@ -71,7 +68,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodPressureViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -89,7 +86,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), Utils.tableColumnValue(diabtec.bloodPressureDate.hour.toString() + ':' + diabtec.bloodPressureDate.minute.toString(), isCapitable: false), Utils.tableColumnValue('${diabtec.measuredArmDesc}', isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), @@ -114,7 +111,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ), ).then((value) { model.getBloodPressure(); - if(model.weekDiabtecPatientResult.isEmpty) { + if (model.weekDiabtecPatientResult.isEmpty) { model.weightWeekTimeSeriesDataTop.clear(); model.weightWeekTimeSeriesDataLow.clear(); } diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 0095fb94..b84afc75 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -26,7 +26,8 @@ class AddBloodSugarPage extends StatefulWidget { final String measuredSelectedType; final BloodSugarViewMode bloodSugarViewMode; - AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) + AddBloodSugarPage( + {Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType}) : super(key: key); @override diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index 5a3710e5..72e2e58b 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -1,7 +1,6 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -11,7 +10,6 @@ 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 BloodMonthlyPage extends StatelessWidget { final List diabtecPatientResult; @@ -24,10 +22,8 @@ class BloodMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( @@ -69,7 +65,7 @@ class BloodMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -79,7 +75,7 @@ class BloodMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, e) { + List fullData(BuildContext context, e) { List tableRow = []; tableRow.add( TableRow( @@ -88,71 +84,6 @@ class BloodMonthlyPage extends StatelessWidget { Utils.tableColumnTitle(TranslationBase.of(context).time), Utils.tableColumnTitle(TranslationBase.of(context).measured), Utils.tableColumnTitle(TranslationBase.of(context).value), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).date, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40, - // ), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).time, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).measured, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).value, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), ], ), ); @@ -161,67 +92,10 @@ class BloodMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.measuredDesc}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.resultValue}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index d4e1698e..4b3b4152 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -1,17 +1,15 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.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 BloodYearPage extends StatelessWidget { final List diabtecPatientResult; @@ -20,23 +18,24 @@ class BloodYearPage extends StatelessWidget { BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key); List yearlyGroup = []; + @override Widget build(BuildContext context) { groupData(); - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( - margin: EdgeInsets.only(top: 12, left: 8, right: 8), - width: double.maxFinite, - color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(context).bloodSugar}', - timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5 ?? 0, - )), + margin: EdgeInsets.only(top: 12, left: 8, right: 8), + width: double.maxFinite, + color: Colors.white, + child: ShowChart( + title: TranslationBase.of(context).weight, + timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, + ), + ), SizedBox( height: 12, ), @@ -69,7 +68,7 @@ class BloodYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -82,7 +81,7 @@ class BloodYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, yearlyGroup) { + List fullData(BuildContext context, yearlyGroup) { List tableRow = []; tableRow.add( TableRow( @@ -99,8 +98,7 @@ class BloodYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 7921d030..d1728610 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -1,18 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'AddBloodSugarPage.dart'; @@ -25,18 +23,17 @@ class BloodSugarWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(AppGlobal.context).bloodSugar}', + child: ShowChart( + title: TranslationBase.of(context).weight, timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, ), ), SizedBox( @@ -63,7 +60,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, bloodSugarViewMode), + children: fullData(context, bloodSugarViewMode), ), SizedBox( height: 80, @@ -76,7 +73,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodSugarViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -94,8 +91,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), @@ -119,7 +115,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), ), ).then((value) { - if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { + if (bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { timeSeriesData.clear(); } }); diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index c7da70cf..b5535982 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,11 +21,12 @@ class MedicalReports extends StatelessWidget { void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, - child: ConfirmDialog( - appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).confirmMsgReport, + onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), ); + return; } ProjectViewModel projectViewModel = Provider.of(context); @@ -36,182 +39,100 @@ class MedicalReports extends StatelessWidget { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF7F7F7), - body: ListView.separated( - physics: BouncingScrollPhysics(), - itemCount: model.appointHistoryList.length, - padding: EdgeInsets.all(21), - separatorBuilder: (context, index) => SizedBox(height: 14), - itemBuilder: (context, index) { - AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; - return InkWell( - onTap: () => confirmBox(model.appointHistoryList[index], model), - child: Container( - decoration: BoxDecoration( - 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: Padding( - padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) - Text( - _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Text( - DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), - ], - ), - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - LargeAvatar( - name: _appointmenHistory.doctorName, - url: _appointmenHistory.doctorImageURL, - width: 48, - height: 48, + body: model.appointHistoryList.isEmpty + ? getNoDataWidget(context) + : ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.appointHistoryList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; + return InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) + Text( + _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Text( + DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + ], + ), + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), + Row( mainAxisSize: MainAxisSize.min, children: [ - if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), - if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RatingBar.readOnly( - initialRating: _appointmenHistory.actualDoctorRate.toDouble(), - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - Icon(Icons.email, color: Color(0xff2B353E)) - ], + LargeAvatar( + name: _appointmenHistory.doctorName, + url: _appointmenHistory.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), + if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: _appointmenHistory.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Icon(Icons.email, color: Color(0xff2B353E)) + ], + ), + ], + ), ), ], ), - ), - ], - ), - ], - ), - ), - ), - ); - }, - ), - ), - ); - } -} - -class ConfirmDialog extends StatefulWidget { - final Function(AppointmentHistory) onOkSelected; - final AppointmentHistory appointmentHistory; - - ConfirmDialog({this.onOkSelected, this.appointmentHistory}); - - @override - _ConfirmDialogState createState() => _ConfirmDialogState(); -} - -class _ConfirmDialogState extends State { - @override - Widget build(BuildContext context) { - return SimpleDialog( - title: Texts(TranslationBase.of(context).confirm), - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts(TranslationBase.of(context).confirmMsgReport), - SizedBox( - height: 5.0, - ), - Divider( - height: 2.5, - color: Colors.grey[500], - ), - SizedBox( - height: 5, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.pop(context), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel, - color: Colors.red, - ), - ), + ], ), ), ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onOkSelected(widget.appointmentHistory); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - ), - ), - ), - ), - ), - ], - ) - ], - ), - ) - ], + ); + }, + ), + ), ); } -} +} \ No newline at end of file diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 9aca16ff..463b0e70 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -17,4 +17,5 @@ class CustomColors { static const Color appBackgroudGreyColor = Color(0xFFF7F7F7); static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8); static const Color green = Color(0xFF359846); + static const Color orange = Color(0xFFCC9B14); } diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 34585002..337d4af0 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -419,9 +419,7 @@ class DateUtil { "/" + dateTime.year.toString() + " " + - dateTime.hour.toString() + - ":" + - dateTime.minute.toString(); + DateFormat('HH:mm').format(dateTime); else return ""; } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index edc2e2e0..0d60500e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2385,6 +2385,12 @@ class TranslationBase { String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode]; String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode]; + + String get RequesterInfo => localizedValues["RequesterInfo"][locale.languageCode]; + String get PatientInfo => localizedValues["PatientInfo"][locale.languageCode]; + String get OtherInfo => localizedValues["OtherInfo"][locale.languageCode]; + String get inPrgress => localizedValues["inPrgress"][locale.languageCode]; + String get locked => localizedValues["locked"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index b7e0f16b..2c796768 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -50,6 +50,7 @@ import 'gif_loader_dialog_utils.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); + class Utils { // static ProgressDialog pr; @@ -518,6 +519,8 @@ class Utils { return medical; } + + static List myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { List medical = List(); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 53969cd7..0b96d8fe 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -360,7 +360,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if (!projectProvider.user.isFamily) Navigator.push(context, FadePage(page: NotificationsPage())); + if (!projectProvider.isLoginChild) Navigator.push(AppGlobal.context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index d50420ab..e24fd6f0 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -174,7 +174,7 @@ class MyInAppBrowser extends InAppBrowser { applePayInsertRequest.longitude = this.long.toString(); applePayInsertRequest.amount = amount.toString(); applePayInsertRequest.isSchedule = "0"; - applePayInsertRequest.language = getLanguageID() == 'ar' ? 'AR' : 'EN'; + applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'AR' : 'EN'; applePayInsertRequest.userName = authenticatedUser.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; @@ -219,7 +219,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, var patientData]) async { getDeviceToken(); - String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; + String currentLanguageID = await getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm(); form = form.replaceFirst("EMAIL_VALUE", emailId); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index ed93fe59..d2ff291e 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -197,6 +197,7 @@ class DoctorHeader extends StatelessWidget { res['DoctorRatingDetailsList'].forEach((v) { doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); }); + this.headerModel.decimalDoctorRate = res['DecimalDoctorRate'].toString(); showRatingDialog(doctorDetailsList, context); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index be545407..12fb9d3e 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -225,31 +225,33 @@ class SMSOTP { }); } - static void showLoadingDialog(BuildContext context, bool _loading) async { - _context = context; - //setSignature(); - if (_loading == false) { - Navigator.of(context).pop(); - return; - } - _loading = true; - await showDialog( - context: _context, - barrierDismissible: false, - builder: (BuildContext context) { - return SimpleDialog( - elevation: 0.0, - backgroundColor: Colors.transparent, - children: [ - Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Colors.black), - ), - ) - ], - ); - }); - } + + // todo 'sikander' remove useless code + // static void showLoadingDialog(BuildContext context, bool _loading) async { + // _context = context; + // //setSignature(); + // if (_loading == false) { + // Navigator.of(context).pop(); + // return; + // } + // _loading = true; + // await showDialog( + // context: _context, + // barrierDismissible: false, + // builder: (BuildContext context) { + // return SimpleDialog( + // elevation: 0.0, + // backgroundColor: Colors.transparent, + // children: [ + // Center( + // child: CircularProgressIndicator( + // valueColor: AlwaysStoppedAnimation(Colors.black), + // ), + // ) + // ], + // ); + // }); + // } static void hideSMSBox(context) { Navigator.pop(context);