From 8b49eed6ae83eb0d3586dd02d9e41420e3129163 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 7 Oct 2021 15:41:16 +0300 Subject: [PATCH] hospital text replaced with branch --- lib/config/localized_values.dart | 1 + .../E-Referral/search_for_referrals_page.dart | 161 ++---- .../h2o/h20_setting.dart | 509 +++++++++++------- .../AlHabibMedicalService/h2o/h2o_page.dart | 179 +++--- .../AlHabibMedicalService/h2o/today_page.dart | 265 +++++---- .../BookAppointment/widgets/DoctorView.dart | 2 +- .../prescriptions/prescriptions_page.dart | 3 + lib/uitl/translations_delegate_base.dart | 2 + .../data_display/medical/doctor_card.dart | 2 +- lib/widgets/others/app_scaffold_widget.dart | 11 +- 10 files changed, 595 insertions(+), 540 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0bd3fad3..9d2193ef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -617,6 +617,7 @@ const Map localizedValues = { "lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"}, "acceptLbl": {"en": "Accept", "ar": "موافقة"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, + "please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "i-am": {"en": "I am", "ar": "أنا"}, 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 49aa2c9b..513eb3b2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -39,17 +39,9 @@ class _SearchForReferralsPageState extends State { TextEditingController _mobileTextController = TextEditingController(); bool _isSubmitted = false; - 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}; - SearchCriteriaModel selectedCriteria = SearchCriteriaModel( - name: "Identification Number", nameAr: "رقم المحول", value: 1); + SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1); @override Widget build(BuildContext context) { @@ -59,23 +51,15 @@ class _SearchForReferralsPageState extends State { if (projectViewModel.isLogin) { Future.delayed(new Duration(milliseconds: 300)).then((value) async { GifLoaderDialogUtils.showMyDialog(context); - SearchEReferralRequestModel searchEReferralRequestModel = - new SearchEReferralRequestModel( - patientMobileNumber: (projectViewModel.user.outSA == 0 - ? "966" - : "971") + - projectViewModel.user.mobileNumber - .substring(1, projectViewModel.user.mobileNumber.length), + SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( + patientMobileNumber: (projectViewModel.user.outSA == 0 ? "966" : "971") + projectViewModel.user.mobileNumber.substring(1, projectViewModel.user.mobileNumber.length), ); if (selectedCriteria.value == 1) { - searchEReferralRequestModel.identificationNo = - _searchTextController.text; + searchEReferralRequestModel.identificationNo = _searchTextController.text; searchEReferralRequestModel.referralNumber = 0; } else { - searchEReferralRequestModel.referralNumber = - int.parse(_searchTextController.text); - searchEReferralRequestModel.identificationNo = - projectViewModel.user.patientIdentificationNo; + searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text); + searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo; } await model.getEReferrals(searchEReferralRequestModel); GifLoaderDialogUtils.hideDialog(context); @@ -102,15 +86,10 @@ class _SearchForReferralsPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getSearchCriteriaName()), - Icon(Icons.arrow_drop_down) - ], + children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], ), ), ), @@ -118,9 +97,7 @@ class _SearchForReferralsPageState extends State { height: 12, ), NewTextFields( - hintText: selectedCriteria.value == 1 - ? "Enter Patient Identification No" - : "Enter Referral Number", + hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number", controller: _searchTextController, onChanged: (_) { setState(() {}); @@ -135,15 +112,10 @@ class _SearchForReferralsPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getCountryName()), - Icon(Icons.arrow_drop_down) - ], + children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)], ), ), ), @@ -155,31 +127,21 @@ class _SearchForReferralsPageState extends State { onChange: (_) { setState(() {}); }, - code: _selectedCountry == null - ? "11" - : _selectedCountry["code"], + code: _selectedCountry == null ? "11" : _selectedCountry["code"], ), SizedBox( height: 12, ), - if ((model.state == ViewState.Idle && - model.allReferral.length == 0)) - Center( - child: Text( - TranslationBase.of(context).noSearchResult)), - if ((model.state == ViewState.ErrorLocal)) - AppEmbeddedError(error: model.error), + if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)), + if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error), model.allReferral.length > 0 ? NetworkBaseView( baseViewModel: model, child: ListView.separated( - separatorBuilder: (context, index) => - SizedBox(height: 0), + separatorBuilder: (context, index) => SizedBox(height: 0), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - itemCount: model.allReferral == null - ? 0 - : model.allReferral.length, + itemCount: model.allReferral == null ? 0 : model.allReferral.length, itemBuilder: (BuildContext context, int index) { return Container( width: double.infinity, @@ -188,9 +150,7 @@ class _SearchForReferralsPageState extends State { Navigator.push( context, FadePage( - page: ReferralDetails( - referral: - model.allReferral[index]), + page: ReferralDetails(referral: model.allReferral[index]), ), ); }, @@ -200,71 +160,22 @@ class _SearchForReferralsPageState extends State { child: Padding( padding: const EdgeInsets.all(12.0), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - projectViewModel.isArabic - ? model - .allReferral[ - index] - .statusAr - : model - .allReferral[ - index] - .status, - style: TextStyle( - fontSize: 14.0, - letterSpacing: -0.56, - fontWeight: - FontWeight.bold)), + Text(projectViewModel.isArabic ? model.allReferral[index].statusAr : model.allReferral[index].status, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), Container( - margin: EdgeInsets.only( - top: 5.0), - child: myRichText( - TranslationBase.of( - context) - .patientName + - ": ", - model - .allReferral[ - index] - .patientName, - projectViewModel - .isArabic)), - myRichText( - TranslationBase.of( - context) - .hospital + - ": ", - model.allReferral[index] - .preferredBranchName, - projectViewModel - .isArabic), - myRichText( - TranslationBase.of( - context) - .referralDate + - ": ", - DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDateNoTimeZone( - model - .allReferral[ - index] - .referralDate)), - projectViewModel - .isArabic), + margin: EdgeInsets.only(top: 5.0), + child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)), + myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic), + myRichText(TranslationBase.of(context).referralDate + ": ", + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic), ], ), - Icon(projectViewModel.isArabic - ? Icons - .arrow_back_ios_outlined - : Icons - .arrow_forward_outlined), + Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined), ], ), ), @@ -289,23 +200,17 @@ class _SearchForReferralsPageState extends State { padding: EdgeInsets.all(14), child: DefaultButton( TranslationBase.of(context).search, - (_searchTextController.text.isEmpty || - _mobileTextController.text.isEmpty) + (_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty) ? null : () async { - SearchEReferralRequestModel - searchEReferralRequestModel = - new SearchEReferralRequestModel( - patientMobileNumber: _selectedCountry['code'] + - _mobileTextController.text, + SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( + patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text, ); if (selectedCriteria.value == 1) { - searchEReferralRequestModel.identificationNo = - _searchTextController.text; + searchEReferralRequestModel.identificationNo = _searchTextController.text; searchEReferralRequestModel.referralNumber = 0; } else { - searchEReferralRequestModel.referralNumber = - int.parse(_searchTextController.text); + searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text); searchEReferralRequestModel.identificationNo = ''; } await model.getEReferrals(searchEReferralRequestModel); diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 55fed349..b944c550 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -95,214 +96,318 @@ class _H2oSettingState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).h2o, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), showHomeAppBarIcon: false, - body: SingleChildScrollView( - padding: EdgeInsets.fromLTRB(8, 8, 8, 80), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextField( - controller: _nameController, - decoration: InputDecoration( - labelText: TranslationBase.of(context).enterNameHere, - labelStyle: TextStyle(color: Colors.black87), - fillColor: Colors.white, - filled: true, - border: UnderlineInputBorder( - borderSide: BorderSide( - width: 0, - style: BorderStyle.none, - ), - borderRadius: BorderRadius.circular(6.0), - ), - ), - ), - SizedBox(height: 8), - Text(TranslationBase.of(context).preferredunit), - SizedBox(height: 8), - _commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) { - if (_isUnitML != value) { - setState(() { - _isUnitML = value; - }); - } - }), - Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 8.0), - child: Divider(height: 1.5, color: Colors.black54), - ), - Text(TranslationBase.of(context).gender), - SizedBox(height: 8), - _commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) { - if (_isGenderMale != value) { - setState(() { - _isGenderMale = value; - }); - } - }), - Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 8.0), - child: Divider(height: 1.5, color: Colors.black54), - ), - Text(TranslationBase.of(context).height), - _commonSlidersRow(_heightController, 1, 270, _heightValue, (text) { - _heightController.text = text; - }, (value) { - setState(() { - _heightValue = value; - }); - }), - SizedBox(height: 8), - Text(TranslationBase.of(context).heightUnit), - SizedBox(height: 8), - _commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) { - if (_isHeightCM != value) { - setState(() { - _isHeightCM = value; - }); - } - }), - SizedBox(height: 8), - _commonSlidersRow(_weightController, 1, 250, _weightValue, (text) { - _weightController.text = text; - }, (value) { - setState(() { - _weightValue = value; - }); - }), - SizedBox(height: 8), - Text(TranslationBase.of(context).weightUnit), - SizedBox(height: 8), - _commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) { - if (_isWeightKG != value) { - setState(() { - _isWeightKG = value; - }); - } - }), - Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 8.0), - child: Divider(height: 1.5, color: Colors.black54), - ), - Container( - padding: EdgeInsets.all(8), - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("${TranslationBase.of(context).birth_date}:"), + inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).enterNameHere, _nameController), + // TextField( + // controller: _nameController, + // decoration: InputDecoration( + // labelText: TranslationBase.of(context).enterNameHere, + // labelStyle: TextStyle(color: Colors.black87), + // fillColor: Colors.white, + // filled: true, + // border: UnderlineInputBorder( + // borderSide: BorderSide( + // width: 0, + // style: BorderStyle.none, + // ), + // borderRadius: BorderRadius.circular(6.0), + // ), + // ), + // ), + SizedBox(height: 16), + Text( + TranslationBase.of(context).preferredunit, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + SizedBox(height: 12), + _commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) { + if (_isUnitML != value) { + setState(() { + _isUnitML = value; + }); + } + }), + SizedBox(height: 12), + Text( + TranslationBase.of(context).pleaseSelectGender, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + SizedBox(height: 12), + _commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) { + if (_isGenderMale != value) { + setState(() { + _isGenderMale = value; + }); + } + }), + SizedBox(height: 12), + Text(TranslationBase.of(context).height), + _commonSlidersRow(_heightController, 1, 270, _heightValue, (text) { + _heightController.text = text; + }, (value) { + setState(() { + _heightValue = value; + }); + }), SizedBox(height: 8), - InkWell( - onTap: () { - showModalBottomSheet( - context: context, - builder: (context) { - return Container( - height: 250, - padding: EdgeInsets.all(8), - child: Column(children: [ - Container( - height: 40, - alignment: Alignment.centerRight, - child: Row(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - onTap: () => Navigator.pop(context), - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.fromLTRB(8, 4, 8, 4), - child: Text(TranslationBase.of(context).cancel), - ), - ), - SizedBox(width: 8), - InkWell( - onTap: () { - Navigator.pop(context); - setState(() { - _dobDate = _tempDate; - }); - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.fromLTRB(8, 4, 8, 4), - child: Text(TranslationBase.of(context).ok), + Text(TranslationBase.of(context).heightUnit), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) { + if (_isHeightCM != value) { + setState(() { + _isHeightCM = value; + }); + } + }), + SizedBox(height: 8), + _commonSlidersRow(_weightController, 1, 250, _weightValue, (text) { + _weightController.text = text; + }, (value) { + setState(() { + _weightValue = value; + }); + }), + SizedBox(height: 8), + Text(TranslationBase.of(context).weightUnit), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) { + if (_isWeightKG != value) { + setState(() { + _isWeightKG = value; + }); + } + }), + Padding( + padding: EdgeInsets.only(top: 8.0, bottom: 8.0), + child: Divider(height: 1.5, color: Colors.black54), + ), + Container( + padding: EdgeInsets.all(8), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("${TranslationBase.of(context).birth_date}:"), + SizedBox(height: 8), + InkWell( + onTap: () { + showModalBottomSheet( + context: context, + builder: (context) { + return Container( + height: 250, + padding: EdgeInsets.all(8), + child: Column(children: [ + Container( + height: 40, + alignment: Alignment.centerRight, + child: Row(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + onTap: () => Navigator.pop(context), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + child: Text(TranslationBase.of(context).cancel), + ), + ), + SizedBox(width: 8), + InkWell( + onTap: () { + Navigator.pop(context); + setState(() { + _dobDate = _tempDate; + }); + }, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + child: Text(TranslationBase.of(context).ok), + ), + ) + ]), ), - ) - ]), - ), - Expanded( - child: Container( - width: MediaQuery.of(context).size.width, - child: CupertinoDatePicker( - initialDateTime: _dobDate, - mode: CupertinoDatePickerMode.date, - onDateTimeChanged: (_date) { - _tempDate = _date; - }, - ), - ), - ) - ]), - ); + Expanded( + child: Container( + width: MediaQuery.of(context).size.width, + child: CupertinoDatePicker( + initialDateTime: _dobDate, + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (_date) { + _tempDate = _date; + }, + ), + ), + ) + ]), + ); + }); + }, // implement cupertino dialog to select date + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]), + ) + ], + ), + ), + SizedBox(height: 8), + _commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () { + showDialog( + context: context, + child: CommonRadioButtonDialog( + list: _activityLevelListEng, + title: TranslationBase.of(context).activityLevel, + onSelect: (index) { + Navigator.pop(context); + setState(() { + _selectedActiveLevel = index + 1; + }); + }, + selectedIndex: _selectedActiveLevel - 1, + ), + ); + }), + SizedBox(height: 8), + _commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () { + showDialog( + context: context, + child: CommonRadioButtonDialog( + list: _remindedTimeListEng, + onSelect: (index) { + Navigator.pop(context); + setState(() { + _selectedRemindedTime = index; }); - }, // implement cupertino dialog to select date - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]), - ) + }, + selectedIndex: _selectedRemindedTime, + ), + ); + }), + SizedBox(height: 16), + SizedBox( + height: 50, + width: MediaQuery.of(context).size.width, + child: FlatButton( + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + onPressed: _updateUserDetails, + child: Text( + TranslationBase.of(context).save, + style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600), + ), + ), + ), ], ), ), - SizedBox(height: 8), - _commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () { - showDialog( - context: context, - child: CommonRadioButtonDialog( - list: _activityLevelListEng, - title: TranslationBase.of(context).activityLevel, - onSelect: (index) { - Navigator.pop(context); - setState(() { - _selectedActiveLevel = index + 1; - }); - }, - selectedIndex: _selectedActiveLevel - 1, - ), - ); - }), - SizedBox(height: 8), - _commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () { - showDialog( - context: context, - child: CommonRadioButtonDialog( - list: _remindedTimeListEng, - onSelect: (index) { - Navigator.pop(context); - setState(() { - _selectedRemindedTime = index; - }); - }, - selectedIndex: _selectedRemindedTime, - ), - ); - }), - SizedBox(height: 16), - SizedBox( - height: 50, - width: MediaQuery.of(context).size.width, - child: FlatButton( - color: Theme.of(context).appBarTheme.color, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - onPressed: _updateUserDetails, - child: Text( - TranslationBase.of(context).save, - style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600), - ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).save, + _updateUserDetails, + color: Color(0xff349745), + ), + ), + ], + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = 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: TextInputType.number, + controller: _controller, + onChanged: (value) => { + // validateForm() + }, + 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, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + prefixIcon: prefix == null + ? null + : Text( + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], ), - ) + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), ], ), ), @@ -310,6 +415,16 @@ class _H2oSettingState extends State { } Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) { + + return Row( + children: [ + Row(children: [ + Checkbox(value: null, onChanged: null) + ],) + + ], + ); + return Row(children: [ Expanded( child: SizedBox( diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 16f9940a..982b9044 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; @@ -13,11 +14,12 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.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'; class H2OPage extends StatefulWidget { @override @@ -44,98 +46,121 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getUserDetail(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).waterTracker, description: TranslationBase.of(context).h2oInfo, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: [ - ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png') + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png') ], showHomeAppBarIcon: false, baseViewModel: model, isHelp: true, appBarIcons: [ - model.isLogin - ? IconButton( - icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), - color: Colors.white, - onPressed: () { - Navigator.push( - context, - FadePage( - page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), - ), - ); - }, - ) - : Container(), - ], - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - alignment: Alignment.center, - // margin: EdgeInsets.only(top: 10.0), - // width: MediaQuery.of(context).size.width * 0.9, - - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts(TranslationBase.of(context).today), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts(TranslationBase.of(context).week), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts(TranslationBase.of(context).month), - ), - ), - ], - ), + if (model.isLogin) + IconButton( + icon: Icon(Icons.settings), + color: Color(0xff2B353E), + onPressed: () { + Navigator.push( + context, + FadePage( + page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), ), - ), - ], + ); + }, ), - ), - backgroundColor: Colors.white, + ], + body: Scaffold( + // extendBodyBehindAppBar: true, + // appBar: PreferredSize( + // preferredSize: Size.fromHeight(65.0), + // child: Stack( + // children: [ + // Positioned( + // bottom: 1, + // left: 0, + // right: 0, + // child: BackdropFilter( + // filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + // child: Container( + // color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), + // height: 70.0, + // ), + // ), + // ), + // Center( + // child: Container( + // height: 60.0, + // alignment: Alignment.center, + // // margin: EdgeInsets.only(top: 10.0), + // // width: MediaQuery.of(context).size.width * 0.9, + // + // child: TabBar( + // isScrollable: false, + // controller: _tabController, + // indicatorWeight: 5.0, + // indicatorSize: TabBarIndicatorSize.tab, + // indicatorColor: Colors.red[800], + // labelColor: Theme.of(context).primaryColor, + // labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), + // unselectedLabelColor: Colors.grey[800], + // tabs: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.28, + // child: Center( + // child: Texts(TranslationBase.of(context).today), + // ), + // ), + // Container( + // width: MediaQuery.of(context).size.width * 0.28, + // child: Center( + // child: Texts(TranslationBase.of(context).week), + // ), + // ), + // Container( + // width: MediaQuery.of(context).size.width * 0.28, + // child: Center( + // child: Texts(TranslationBase.of(context).month), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // backgroundColor: Colors.white, body: Column( children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)], + ), Expanded( child: TabBarView( physics: BouncingScrollPhysics(), diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 03d11f50..1a5105a0 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -25,145 +25,144 @@ class TodayPage extends StatelessWidget { appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 12), - child: Container( - margin: EdgeInsets.only(top: 60), - child: Column( - children: [ - Center( - child: CircularPercentIndicator( - radius: 180.0, - animation: true, - animationDuration: 1200, - lineWidth: 15.0, - percent: model.userProgressData == null - ? 0.0 - : (model.userProgressData.percentageConsumed / 100) >= 1 - ? 1 - : (model.userProgressData.percentageConsumed / 100), - center: Center( - child: FutureBuilder( - future: readPrefs(), - builder: (context, data) { - var isUnitML = true; - String unit; - if (data.connectionState == ConnectionState.done) { - isUnitML = data.data; - } - if (isUnitML) { - unit = TranslationBase.of(context).ml; - } else { - unit = TranslationBase.of(context).l; - } - unit = unit.toLowerCase(); - var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0; - var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0; - if (!isUnitML) { - totalH2O = totalH2O / 1000; - consumedH2O = consumedH2O / 1000; - } - var remainingH2O = totalH2O - consumedH2O; + padding: EdgeInsets.all(21), + child: Column( + children: [ - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - // SizedBox( - // height: 40, - // ), - Text( - TranslationBase.of(context).consumed, - style: TextStyle(fontSize: 16.0), - ), - SizedBox( - height: 4, - ), - Text( - model.userProgressData == null ? "0.0" : "$consumedH2O $unit", - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), - ), - SizedBox( - height: 4, - ), - SizedBox( - height: 5, - width: 50, - child: Container(), - ), - SizedBox( - height: 4, - ), - Text( - TranslationBase.of(context).remaining, - style: TextStyle(fontSize: 16.0), - ), - SizedBox( - height: 4, - ), - Text( - model.userProgressData == null - ? "0.0" - : (remainingH2O) < 0 - ? "0 $unit" - : '$remainingH2O $unit', - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), - ), - ], - ); - }, - ), + + Center( + child: CircularPercentIndicator( + radius: 180.0, + animation: true, + animationDuration: 1200, + lineWidth: 15.0, + percent: model.userProgressData == null + ? 0.0 + : (model.userProgressData.percentageConsumed / 100) >= 1 + ? 1 + : (model.userProgressData.percentageConsumed / 100), + center: Center( + child: FutureBuilder( + future: readPrefs(), + builder: (context, data) { + var isUnitML = true; + String unit; + if (data.connectionState == ConnectionState.done) { + isUnitML = data.data; + } + if (isUnitML) { + unit = TranslationBase.of(context).ml; + } else { + unit = TranslationBase.of(context).l; + } + unit = unit.toLowerCase(); + var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0; + var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0; + if (!isUnitML) { + totalH2O = totalH2O / 1000; + consumedH2O = consumedH2O / 1000; + } + var remainingH2O = totalH2O - consumedH2O; + + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + // SizedBox( + // height: 40, + // ), + Text( + TranslationBase.of(context).consumed, + style: TextStyle(fontSize: 16.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null ? "0.0" : "$consumedH2O $unit", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), + ), + SizedBox( + height: 4, + ), + SizedBox( + height: 5, + width: 50, + child: Container(), + ), + SizedBox( + height: 4, + ), + Text( + TranslationBase.of(context).remaining, + style: TextStyle(fontSize: 16.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null + ? "0.0" + : (remainingH2O) < 0 + ? "0 $unit" + : '$remainingH2O $unit', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), + ), + ], + ); + }, ), - circularStrokeCap: CircularStrokeCap.butt, - backgroundColor: HexColor("#D1E3F6"), - progressColor: HexColor("#60BCF9"), ), + circularStrokeCap: CircularStrokeCap.butt, + backgroundColor: HexColor("#D1E3F6"), + progressColor: HexColor("#60BCF9"), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(bottom: 16), - height: 30, - width: 70, - decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))), - ), - Text( - "${TranslationBase.of(context).remaining} %", - style: TextStyle(fontSize: 16.0), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(bottom: 16), - height: 30, - width: 70, - decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))), - ), - Text( - "${TranslationBase.of(context).consumed} %", - style: TextStyle(fontSize: 16.0), - ) - ], - ) - ], - ), - SizedBox( - height: 30, - ), - SizedBox( - height: 0.5, - width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.grey, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(bottom: 16), + height: 30, + width: 70, + decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))), + ), + Text( + "${TranslationBase.of(context).remaining} %", + style: TextStyle(fontSize: 16.0), + ) + ], ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(bottom: 16), + height: 30, + width: 70, + decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))), + ), + Text( + "${TranslationBase.of(context).consumed} %", + style: TextStyle(fontSize: 16.0), + ) + ], + ) + ], + ), + SizedBox( + height: 30, + ), + SizedBox( + height: 0.5, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey, ), - ], - ), + ), + ], ), ), floatingActionButton: H20FloatingActionButton( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 1ae738cf..f0a59fe5 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -74,7 +74,7 @@ class DoctorView extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic), - if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic), + if (doctor.projectName != null) myRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic), if (doctor.speciality != null) Text( getDoctorSpeciality(this.doctor.speciality).trim(), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 4d9eb463..389a50e5 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -45,6 +45,8 @@ class PrescriptionsPage extends StatelessWidget { padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), itemBuilder: (context, _index) { Prescriptions prescriptions = prescriptionsList[_index]; + + bool _isSortByClinic = filterType == FilterType.Clinic; return DoctorCard( onTap: () async { final _shouldRecallApi = await Navigator.push( @@ -63,6 +65,7 @@ class PrescriptionsPage extends StatelessWidget { profileUrl: prescriptions.doctorImageURL, rating: prescriptions.actualDoctorRate.toDouble(), subName: prescriptions.name, + isSortByClinic: _isSortByClinic, isInOutPatient: prescriptions.isInOutPatient, isLiveCareAppointment: prescriptions.isLiveCareAppointment, // appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 682da6a6..ef19f170 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -86,6 +86,8 @@ class TranslationBase { String get gender => localizedValues['gender'][locale.languageCode]; + String get pleaseSelectGender => localizedValues['please_select_gender'][locale.languageCode]; + String get nationality => localizedValues['nationality'][locale.languageCode]; String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index a8f87e25..e527fd32 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -164,7 +164,7 @@ class DoctorCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic), + myRichText(isSortByClinic ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 3fef65fb..b0316542 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -114,7 +114,7 @@ class AppScaffold extends StatelessWidget { dropdownIndexValue: dropdownIndexValue, dropDownList: dropDownList ?? [], dropDownIndexChange: dropDownIndexChange, - ) + appBarIcons: appBarIcons) : (isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -166,7 +166,9 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { final int dropdownIndexValue; List dropDownList; final Function(int) dropDownIndexChange; - NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.dropdownIndexValue, this.dropDownIndexChange}) : super(key: key); + final List appBarIcons; + NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange}) + : super(key: key); @override Widget build(BuildContext context) { @@ -224,9 +226,12 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { ), ), ), - ) + ), ], ), + actions: [ + if (appBarIcons != null) ...appBarIcons, + ], ); }