diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6245735d..596bb086 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -242,6 +242,10 @@ const Map localizedValues = { "en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح" }, + "EmailSentError": { + "en": "Error Sending Email", + "ar": "خطأ في إرسال البريد الإلكتروني" + }, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, @@ -1218,6 +1222,10 @@ const Map localizedValues = { "en": "Send a copy of this report to the email", "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" }, + "update-email-msg": { + "en": "Email updated", + "ar": "تم تحديث البريد الالكتروني" + }, "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, "booked-success": { "en": "The appointment has been successfully booked.", @@ -1465,4 +1473,30 @@ const Map localizedValues = { "en": "Nearest ER", "ar": "أقرب ER" }, + "covid19_driveThrueTest": { + "en": "'Covid-19- Drive-Thru Test'", + "ar": "Covid-19- الفحص من خلال القيادة" + }, + "E-Referral": { + "en": "'E-Referral'", + "ar": "الإحالة الإلكترونية" + }, + "childName": { + "en": "'CHILD NAME'", + "ar": "إسم الطفل" + }, + "recordDeleted": { + "en": "'Record Deleted'", + "ar": "تم حذف السجل" + }, + "msg_email_address_up_to_date": { + "en": "Please ensure that the email address is up-to-date and process to view the schedule", + "ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" + }, + "add-new-child": {"en" : "ADD NEW CHILD", "ar": "إضافة طفل جديد"}, + "visit": {"en" : "Visit", "ar": "الزيارة"}, + "send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"}, + "vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."}, + "child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"}, + }; diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart index 7f987b76..fc2b40e9 100644 --- a/lib/core/service/childvaccines/vaccination_table_service.dart +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import '../base_service.dart'; class VaccinationTableService extends BaseService { @@ -10,19 +12,18 @@ class VaccinationTableService extends BaseService { - Future getCreateVaccinationTableOrders() async { + Future getCreateVaccinationTableOrders(List_BabyInformationModel babyInfo, bool sendEmail) async { + String babyBDFormatted = "${DateUtil.convertDateToString(babyInfo.dOB)}/"; + hasError = false; await getUser(); - body['BabyName']="fffffffffff eeeeeeeeeeeeee"; - body['DOB'] = "/Date(1585774800000+0300)/"; + body['BabyName']= babyInfo.babyName; + body['DOB'] = babyBDFormatted; body['EmailAddress'] = user.emailAddress; body['isDentalAllowedBackend'] = false; - body['SendEmail'] = false; + body['SendEmail'] = sendEmail; body['IsLogin'] =true; - - - await baseAppClient.post(GET_TABLE_REQUEST, onSuccess: (dynamic response, int statusCode) { createVaccinationTableModelList.clear(); diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart index 3b72dd50..d0ccb8a1 100644 --- a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; @@ -11,14 +12,12 @@ import '../base_view_model.dart'; class VaccinationTableViewModel extends BaseViewModel{ VaccinationTableService _creteVaccinationTableService = locator(); + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList; - // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; - //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; - List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; - getCreateVaccinationTable() async { + getCreateVaccinationTable(List_BabyInformationModel babyInfo, bool sendEmail) async { setState(ViewState.Busy); - await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo, sendEmail);//getCreateNewBabyOrders(); if ( _creteVaccinationTableService.hasError) { error = _creteVaccinationTableService.error; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 1359ab8d..3c3c18c1 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -203,7 +203,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', - title: 'Covid-19- Drive-Thru Test', + title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( onTap: () { @@ -227,7 +227,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/pharmacy_logo.png', - title: 'Pharmacy'), + title: TranslationBase.of(context).pharmacy), ServicesContainer( onTap: () => Navigator.push( context, @@ -248,7 +248,7 @@ class _AllHabibMedicalServiceState extends State { : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', - title: 'E-Referral', + title: TranslationBase.of(context).ereferral, ), ServicesContainer( onTap: () => Navigator.push( @@ -259,7 +259,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/family_menu_icon_red.png', - title: 'My Family', + title: TranslationBase.of(context).myFamily, ), if(projectViewModel.havePrivilege(35)) ServicesContainer( @@ -269,7 +269,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/children_vaccines_icon.png', - title: 'Child Vaccines', + title: TranslationBase.of(context).childVaccine, ), ServicesContainer( onTap: () => Navigator.push( @@ -289,7 +289,7 @@ class _AllHabibMedicalServiceState extends State { FadePage(page: SymptomInfo()), ), imageLocation: 'assets/images/new-design/body_icon.png', - title: 'Symptom Checker'), + title: TranslationBase.of(context).symptomCheckerTitle), if(projectViewModel.havePrivilege(36)) ServicesContainer( onTap: () => Navigator.push( @@ -297,7 +297,7 @@ class _AllHabibMedicalServiceState extends State { FadePage(page: BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', - title: 'Blood Donation', + title: TranslationBase.of(context).bloodD, ), ServicesContainer( onTap: () => Navigator.push( @@ -308,7 +308,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/health_calculator_icon.png', - title: 'Health Calculators', + title: TranslationBase.of(context).calculators, ), ServicesContainer( onTap: () => Navigator.push( @@ -319,7 +319,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/health_convertor_icon.png', - title: 'Health Converter', + title: TranslationBase.of(context).converters, ), if(projectViewModel.havePrivilege(38)) ServicesContainer( @@ -370,7 +370,7 @@ class _AllHabibMedicalServiceState extends State { }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', - title: 'Latest News', + title: TranslationBase.of(context).latestNews, ), ServicesContainer( onTap: () => Navigator.push( diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 51b89f98..3c0d072b 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -84,10 +85,12 @@ class _AddNewChildPageState extends State { @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: "Vaccintion", + appBarTitle: TranslationBase.of(context).vaccination, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -96,10 +99,10 @@ class _AddNewChildPageState extends State { // crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 50, + height: 20, ), Texts( - "Add the child's information below to recieve the schedule of vaccinations.", + TranslationBase.of(context).vaccinationAddChildMsg, //+model.user.firstName, textAlign: TextAlign.center, ), @@ -107,14 +110,14 @@ class _AddNewChildPageState extends State { height: 12, ), NewTextFields( - hintText: "First Name", + hintText: TranslationBase.of(context).firstName, controller: _firstTextController, ), SizedBox( height: 12, ), NewTextFields( - hintText: "Second Name", + hintText: TranslationBase.of(context).middleName, controller: _secondTextController, ), SizedBox( @@ -124,62 +127,57 @@ class _AddNewChildPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Gender:", + TranslationBase.of(context).gender, textAlign: TextAlign.end, ), ], ), Container( - height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, + height: size.height * 0.12, padding: EdgeInsets.all(12), - - child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 175, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 1 ? Colors.white : Colors.black, - color: checkedValue == 1 ? Colors.red : Colors.white, - - label: "Male", - // - onTap: () { + Expanded( + child: Container( + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + label: TranslationBase.of(context).male, + onTap: () { + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); - setState(() { - checkedValue = 1; - print("checkedValue=" + checkedValue.toString()); - }); - - // bloodDetails. - }, + // bloodDetails. + }, + ), ), ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 175, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 2 ? Colors.white : Colors.black, - color: checkedValue == 2 ? Colors.red : Colors.white, - label: "Female", - // - onTap: () { - setState(() { - checkedValue = 2; - print("checkedValue=" + checkedValue.toString()); - }); - // bloodDetails.city=_selectedHospital.toString(); + Expanded( + child: Container( + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 2 ? Colors.white : Colors.black, + color: checkedValue == 2 ? Colors.red : Colors.white, + label: TranslationBase.of(context).female, + // + onTap: () { + setState(() { + checkedValue = 2; + print("checkedValue=" + checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); - // bloodDetails. - }, + // bloodDetails. + }, + ), ), ) ], @@ -193,7 +191,7 @@ class _AddNewChildPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Date Of Birth::", + TranslationBase.of(context).dob, textAlign: TextAlign.end, ), ], @@ -249,29 +247,29 @@ class _AddNewChildPageState extends State { color: checkedValue == false ? Colors.white24 : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "Add", + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).add, // - onTap: () async{ - newChild.babyName = _firstTextController.text + " " + _secondTextController.text; + onTap: () async { + newChild.babyName = _firstTextController.text + + " " + + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB = getStartDay(); newChild.tempValue = true; newChild.isLogin = true; await model.createNewBabyOrders(newChild: newChild); - if(model.isAdded){ - AppToast.showSuccessToast(message: "Record Added"); - Navigator.pop(context,model.isAdded); - }else{ - + if (model.isAdded) { + AppToast.showSuccessToast(message: TranslationBase.of(context).childAddedSuccessfully); + Navigator.pop(context, model.isAdded); + } else { //TODO handling error } - }, ), ), @@ -280,7 +278,7 @@ class _AddNewChildPageState extends State { ), ), ), - // bottomSheet: + // bottomSheet: ), ); } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 806a5b71..ae33cc03 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart' import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -22,30 +23,51 @@ class ChildPage extends StatefulWidget { class _ChildPageState extends State with SingleTickerProviderStateMixin { - DeleteBaby deleteBaby = DeleteBaby(); @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double height = (size.height - kToolbarHeight - 60); + final double itemWidth = size.width / 2; + final double itemHeight = height / 2 + 40; + var checkedValue = true; return BaseView( onModelReady: (model) => model.getNewUserOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: " Vaccination", + appBarTitle: TranslationBase.of(context).vaccination, baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15, right: 15, top: 70), - child: Column( - children: [ - ...List.generate( + body: Container( + height: height * 0.85, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 16), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / (itemHeight + 0)), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: ScrollController(keepScrollOffset: true), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: [ + ...List.generate( model.babyInformationModelList.length, - (index) => Container( - margin: EdgeInsets.only( - left: 0, right: 0, bottom: 20), - - decoration: BoxDecoration( + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(model.babyInformationModelList[index]), + ), + ); + }, + child: Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border.all( color: Colors.white, width: 0.5), @@ -54,11 +76,12 @@ class _ChildPageState extends State color: Colors.white, ), padding: EdgeInsets.all(12), - width: 200,//double.infinity, + //double.infinity, child: Column( children: [ Row(children: [ - Texts("CHILD NAME"), + Texts(TranslationBase.of(context) + .childName), ]), Row(children: [ Texts(model @@ -96,19 +119,14 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - - - page: VaccinationTablePage(), - - + page: VaccinationTablePage(model.babyInformationModelList[index]), ), ); - }, ) ]), Row(children: [ - Texts("Birthday"), + Texts(TranslationBase.of(context).dob), ]), Row(children: [ IconButton( @@ -116,9 +134,7 @@ class _ChildPageState extends State 'assets/images/new-design/calender-secondary.png'), tooltip: '', onPressed: () { - setState(() { - - }); + setState(() {}); }, ), Texts(DateUtil.yearMonthDay(model @@ -130,73 +146,71 @@ class _ChildPageState extends State icon: new Image.asset( 'assets/images/new-design/garbage.png'), tooltip: '', - onPressed: ()async { - + onPressed: () async { //===================== - await model.deleteBabyOrders(newChild:deleteBaby ); - + await model.deleteBabyOrders( + newChild: deleteBaby); - deleteBaby.babyID=model.babyInformationModelList[index] + deleteBaby.babyID = model + .babyInformationModelList[index] .babyID; - await model.deleteBabyOrders(newChild:deleteBaby ); - if(model.isDeleted){ - AppToast.showSuccessToast(message: "Record Deleted"); - Navigator.pop(context,model.isDeleted); - }else{ - - //TODO handling error - } - - - - - + await model.deleteBabyOrders( + newChild: deleteBaby); + if (model.isDeleted) { + AppToast.showSuccessToast( + message: + TranslationBase.of(context) + .recordDeleted); + Navigator.pop( + context, model.isDeleted); + } else { + //TODO handling error + } }, ), - Texts("Delete"), + Texts(TranslationBase.of(context) + .deleteView), ]), SizedBox( height: 12, ), ], ), - + ), ), - - - ) - ], - )) + ) + ], + ))), ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "ADD NEW CHILD ", - // - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddNewChildPage(), - ), - ).then((value) { - if (value) model.getNewUserOrders(); - }); - }, - ), + bottomSheet: Container( + height: height * 0.15, + width: double.infinity, + padding: EdgeInsets.all(16), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, ), + label: TranslationBase.of(context).addNewChild, + // + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); + }, + ), + ), )); } } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 92f3a0be..38c6b5af 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,10 +1,10 @@ - import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; @@ -13,214 +13,218 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - - class ChildVaccinesPage extends StatefulWidget { @override _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } class _ChildVaccinesPageState extends State - with SingleTickerProviderStateMixin{ + with SingleTickerProviderStateMixin { TextEditingController titleController = TextEditingController(); - var checkedValue=false; - String addEmail=""; + var checkedValue = false; + String addEmail = ""; + @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - SizedBox( - height: 20, - ), - - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - child: Texts("Welcome back",fontSize: 20,), - ) , - ), - Divider(color:Colors.black , indent: 10, - endIndent: 10,), - SizedBox( - height: 20, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), - ) , + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).vaccination, + //TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).welcomeBack, + fontSize: 20, ), - - Divider(color:Colors.black , indent: 10, - endIndent: 10,), - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - fillColor: Colors.red, - - hintText: model.user.emailAddress, - controller: titleController, - fontSize: 20, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - onChanged: (text) { - addEmail=text; - model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; - - - }, - validator: (value) { - - if (value == null) - { - return model.user.emailAddress; - - } - else - - { - return model.user.emailAddress;} - }, - ), - ), + ), + ), + Divider( + color: Colors.black, + indent: 10, + endIndent: 10, + ), + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).msg_email_address_up_to_date, + fontSize: 20, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "UPDATE EMAIL", - // - onTap: (){ - model.user.emailAddress=addEmail.toString(); - AppToast.showSuccessToast( - message: "Email updated"); - // bloodDetails.city=_selectedHospital.toString(); - - // bloodDetails. - }, - + ), + ), - ), + Divider( + color: Colors.black, + indent: 10, + endIndent: 10, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + fillColor: Colors.red, + hintText: model.user.emailAddress, + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail = text; + model.user.emailAddress == addEmail + ? checkedValue = false + : checkedValue = true; + }, + validator: (value) { + if (value == null) { + return model.user.emailAddress; + } else { + return model.user.emailAddress; + } + }, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: Color.fromRGBO(63, 72, 74, 1,), - label: " VIEW LIST OF CHILDREN", - // - onTap: () => Navigator.push( - context, - FadePage( - page: ChildPage(), - - - - ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, ), - - - ), - ), - - // Texts( - // // TranslationBase.of(context).advancePaymentLabel, - // model.user.emailAddress, - // textAlign: TextAlign.center, - // ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, + label: TranslationBase.of(context).updateEmail, + // + onTap: () { + model.user.emailAddress = addEmail.toString(); + AppToast.showSuccessToast( + message: TranslationBase.of(context).updateEmailMsg); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO( + 63, + 72, + 74, + 1, ), - - SizedBox( - height: 12, + label: TranslationBase.of(context).viewListChildren, + // + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), + ), ), + ), + ), - SizedBox( - height: 12, - ), + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // textAlign: TextAlign.center, + // ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Center( - // child: Container( - // color: Colors.white, - // width: 350, - // child: InkWell( - // onTap: () { - // showDialog( - // context: context, - // builder: (_) => - // AssetGiffyDialog( - // title: Text( - // "", - // style: TextStyle( - // fontSize: 22.0, - // fontWeight: - // FontWeight - // .w600), - // ), - // image: Image.asset( - // 'assets/images/BloodChrt_EN.png'), - // buttonCancelText: - // Text('cancel'), - // buttonCancelColor: - // Colors.grey, - // onlyCancelButton: true, - // )); - // }, - // child: Container( - // width: 250, - // height: 200, - // child:Image.asset( - // 'assets/images/BloodChrt_EN.png')), - // ), - // ), - // ), - // ], - // ), + SizedBox( + height: 12, + ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.15, - ) - ], + SizedBox( + height: 12, ), + SizedBox( + height: 10, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Center( + // child: Container( + // color: Colors.white, + // width: 350, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // builder: (_) => + // AssetGiffyDialog( + // title: Text( + // "", + // style: TextStyle( + // fontSize: 22.0, + // fontWeight: + // FontWeight + // .w600), + // ), + // image: Image.asset( + // 'assets/images/BloodChrt_EN.png'), + // buttonCancelText: + // Text('cancel'), + // buttonCancelColor: + // Colors.grey, + // onlyCancelButton: true, + // )); + // }, + // child: Container( + // width: 250, + // height: 200, + // child:Image.asset( + // 'assets/images/BloodChrt_EN.png')), + // ), + // ), + // ), + // ], + // ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], ), - ), + ), + ), ); } } - diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 259bbdb7..c08749b8 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -7,8 +7,11 @@ import 'package:flutter/material.dart'; class SelectGenderDialog extends StatefulWidget { final Email; + final Function okFunction; + + const SelectGenderDialog({Key key, this.Email, this.okFunction}) + : super(key: key); - const SelectGenderDialog({Key key, this.Email}) : super(key: key); @override _SelectGenderDialogState createState() => _SelectGenderDialogState(); } @@ -33,9 +36,8 @@ class _SelectGenderDialogState extends State { }); }, child: ListTile( - title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), - - + title: Text( + "${TranslationBase.of(context).sendChildEmailMsg}\n Tamer.dasdasdas@gmail.com "), ), ), ) @@ -44,7 +46,6 @@ class _SelectGenderDialogState extends State { SizedBox( height: 5.0, ), - SizedBox( height: 5.0, ), @@ -82,7 +83,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { - AppToast.showSuccessToast(message: "Email Sended"); + widget.okFunction(); // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, @@ -105,7 +106,4 @@ class _SelectGenderDialogState extends State { ], ); } - - - } diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index c160acfb..7b8499e0 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -1,8 +1,13 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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'; @@ -12,91 +17,161 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'dialogs/SelectGenderDialog.dart'; class VaccinationTablePage extends StatelessWidget { + final List_BabyInformationModel babyInfo; + + VaccinationTablePage(this.babyInfo); + @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double height = (size.height - kToolbarHeight - 60); + var checkedValue; return BaseView( - onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), + onModelReady: (model) => model.getCreateVaccinationTable(babyInfo, false), builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, - appBarTitle: "Vaccination", - body: SingleChildScrollView( - child:Container( - margin: EdgeInsets.only(left: 15,right: 15,top: 70), - child: Column( - children: [//babyInformationModelList.length - ...List.generate(model.creteVaccinationTableModelList.length, (index) => - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - - ), - padding: EdgeInsets.all(12), - width: double.infinity, - child: Column( - - children: [ - Row(children: [ - Text(model.creteVaccinationTableModelList[index].visit), - SizedBox(width: 10,), - - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Html( - // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription - data:model.creteVaccinationTableModelList[index].vaccinesDescription, - - ), - ],), - ), - Text(model.creteVaccinationTableModelList[index].givenAt), - - - ],), - Divider(color:Colors.black ,), - - ], - ) - - - ) - - ) - ], + appBarTitle: TranslationBase.of(context).vaccination, + body: Container( + height: height * 0.85, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 16, right: 16, top: 16), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Texts(TranslationBase.of(context).childName), + ), + Expanded( + child: Texts(TranslationBase.of(context).dob), + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: Texts(babyInfo.babyName), + ), + Expanded( + child: Texts(DateUtil.getFormattedDate( + babyInfo.dOB, "MMM dd,yyyy")), + ), + ], + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.black, + ), + Row( + children: [ + Text(TranslationBase.of(context).visit), + SizedBox( + width: 25, + ), + Expanded( + child: Text(TranslationBase.of(context).description)), + Text(TranslationBase.of(context).dueDate), + ], + ), + ...List.generate( + model.creteVaccinationTableModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + // border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + // color: Colors.white, + ), + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + children: [ + Row( + children: [ + Text(model + .creteVaccinationTableModelList[index] + .visit), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data: model + .creteVaccinationTableModelList[ + index] + .vaccinesDescription, + ), + ], + ), + ), + Text(model + .creteVaccinationTableModelList[index] + .givenAt), + ], + ), + Divider( + color: Colors.black, + ), + ], + ))) + ], + ), ), - + ), ), - ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, + height: height * 0.15, width: double.infinity, - padding: EdgeInsets.all(12), child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "Send Email ", - // - onTap: () { - //SelectGenderDialog(); + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).sendEmail, + // + onTap: () { + //SelectGenderDialog(); //=============== - showDialog( - context: context, - child: SelectGenderDialog( - ), - ); - //========= - } - - - ), + showDialog( + context: context, + child: SelectGenderDialog( + okFunction: () async { + await model.getCreateVaccinationTable(babyInfo, true); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast( + message: TranslationBase.of(context) + .emailSentSuccessfully); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context) + .EmailSentError); + } + }, + ), + ); + //========= + }), ), ), ); diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 43bc9f0a..b09a579d 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 460a4066..9f959885 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -4,7 +4,7 @@ import 'package:intl/intl.dart'; class DateUtil { /// convert String To Date function /// [date] String we want to convert - static DateTime convertStringToDate(String date) { + static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ if (date != null) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 257ceb8e..fe0b6bc3 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -581,6 +581,8 @@ class TranslationBase { localizedValues['UpdateSuccessfully'][locale.languageCode]; String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get EmailSentError => + localizedValues['EmailSentError'][locale.languageCode]; String get checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; String get myVaccinesAvailability => @@ -1172,6 +1174,7 @@ class TranslationBase { String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get scanNow => localizedValues['scan-now'][locale.languageCode]; String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; + String get recordDeleted => localizedValues['recordDeleted'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; @@ -1214,7 +1217,6 @@ class TranslationBase { String get viewListChildren => localizedValues['view-list-children'][locale.languageCode]; String get addChild => localizedValues['add-child'][locale.languageCode]; - String get childName => localizedValues['child-name'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode]; String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode]; @@ -1247,7 +1249,16 @@ class TranslationBase { String get driveThru => localizedValues['driveThru'][locale.languageCode]; String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; - + String get covid19_driveThrueTest => localizedValues['covid19_driveThrueTest'][locale.languageCode]; + String get eReferral => localizedValues['E-Referral'][locale.languageCode]; + String get vaccination => localizedValues["vaccination"][locale.languageCode]; + String get msg_email_address_up_to_date => localizedValues["msg_email_address_up_to_date"][locale.languageCode]; + String get updateEmailMsg => localizedValues["update-email-msg"][locale.languageCode]; + String get childName => localizedValues["childName"][locale.languageCode]; + String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; + String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; + String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; + String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; }