From 0443a37886a5dc116ddf16806cf0d24e9aa81007 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sat, 7 Nov 2020 18:39:23 +0300 Subject: [PATCH] register page updated --- lib/config/localized_values.dart | 1 + lib/pages/login/register-info.dart | 49 +++++++++++++++++++++--- lib/uitl/translations_delegate_base.dart | 2 + 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8bcff719..949c0629 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -683,4 +683,5 @@ const Map> localizedValues = { "Book": {"en": "Book", "ar": "احجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, + "marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"} }; diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index a3240665..7aa95696 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/Authentication/register_user_requet. import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/buttons/defaultButton.dart'; @@ -83,13 +84,29 @@ class _RegisterInfo extends State { top: 20, bottom: 20, left: 10, right: 10), readOnly: true, )), - AppText(TranslationBase.of(context).name), + AppText(TranslationBase.of(context).firstName), Container( margin: EdgeInsets.only(bottom: 10), child: TextFields( - hintText: registerInfo.firstNameEn + - ' ' + - registerInfo.lastNameEn, + hintText: registerInfo.firstNameEn, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).middleName), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.secondNameEn, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), + AppText(TranslationBase.of(context).lastName), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.lastNameEn, padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), readOnly: true, @@ -107,6 +124,15 @@ class _RegisterInfo extends State { top: 20, bottom: 20, left: 10, right: 10), readOnly: true, )), + AppText(TranslationBase.of(context).maritalStatus), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText: registerInfo.maritalStatus, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), AppText(TranslationBase.of(context).nationality), Container( margin: EdgeInsets.only(bottom: 10), @@ -116,6 +142,15 @@ class _RegisterInfo extends State { top: 20, bottom: 20, left: 10, right: 10), readOnly: true, )), + AppText(TranslationBase.of(context).mobileNumber), + Container( + margin: EdgeInsets.only(bottom: 10), + child: TextFields( + hintText:registerd_data.patientMobileNumber, + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + readOnly: true, + )), AppText(TranslationBase.of(context).dob), Container( margin: EdgeInsets.only(bottom: 10), @@ -190,6 +225,7 @@ class _RegisterInfo extends State { child: TextFields( onChanged: (value) { this.email = value; + this.isValid(); }, padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), @@ -211,7 +247,7 @@ class _RegisterInfo extends State { : TranslationBase.of(context).register, () => {nextPage()}, textColor: Colors.white, - color: this.isValid() == false + color: this.isValid() == false && page == 2 ? Colors.grey : Colors.black, )) @@ -266,7 +302,8 @@ class _RegisterInfo extends State { "MiddleName": registerInfo.secondNameEn, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": "/Date(1522098000000)/", + "DateofBirth": + DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth), "Gender": registerInfo.gender, "NationalityID": registerInfo.nationality, "DateofBirthN": registerInfo.dateOfBirth, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d763ed04..551cd8ff 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -736,6 +736,8 @@ class TranslationBase { String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; + String get maritalStatus => + localizedValues['marital-status'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {