diff --git a/assets/images/svg/arrow-down.svg b/assets/images/svg/arrow-down.svg new file mode 100644 index 00000000..48a4e38b --- /dev/null +++ b/assets/images/svg/arrow-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svg/birthday-cake.svg b/assets/images/svg/birthday-cake.svg new file mode 100644 index 00000000..3f5c8756 --- /dev/null +++ b/assets/images/svg/birthday-cake.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svg/calendar.svg b/assets/images/svg/calendar.svg new file mode 100644 index 00000000..06bdb26b --- /dev/null +++ b/assets/images/svg/calendar.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/svg/ksa.svg b/assets/images/svg/ksa.svg new file mode 100644 index 00000000..d91255ae --- /dev/null +++ b/assets/images/svg/ksa.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/svg/uae.svg b/assets/images/svg/uae.svg new file mode 100644 index 00000000..69da43ac --- /dev/null +++ b/assets/images/svg/uae.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8c2ccb4e..7922976e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2328,5 +2328,8 @@ const Map localizedValues = { "liveCareTermsConditions48": {"en": "If you have any complaints or concerns about the Application and or the Website, Our Services, or how we handle your personal information please contact us on: EServices.HMG@drsulaimanalhabib.com or call 011 525 9553", "ar": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011"}, "clickPrivacyPolicy": {"en": "Please click here to view the privacy policy", "ar": "الرجاء الضغط هنا لعرض سياسة الخصوصية"}, "welcomeToDrSulaiman": {"en": "Welcome to Dr. Sulaiman Al Habib Medical Group", "ar": "مرحباً بكم في مجموعة الدكتور سليمان الحبيب الطبية"}, - "dontHaveAccount": {"en": "Don’t have an account?", "ar": "ليس لديك حساب؟"} + "dontHaveAccount": {"en": "Don’t have an account?", "ar": "ليس لديك حساب؟"}, + "prepareToElevate": {"en": "Prepared to elevate your health and well-being?", "ar": "هل أنت مستعد لتحسين صحتك ورفاهتك؟"}, + "alreadyHaveAccount": {"en": "Already have an account?", "ar": "هل لديك حساب بالفعل؟"}, + "loginNow": {"en": "Login Now", "ar": "تسجيل الدخول الآن"} }; diff --git a/lib/main.dart b/lib/main.dart index b4760a51..9bdbd89d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -201,6 +201,7 @@ class _MyApp extends State { const Locale('ar', ''), // Arabic const Locale('en', ''), // English ], + theme: Provider.of(context).getTheme(), initialRoute: SPLASH, // initialRoute: CALL_PAGE, diff --git a/lib/new_ui/otp/otp_validation_bootmsheet_widget.dart b/lib/new_ui/otp/otp_validation_bootmsheet_widget.dart index 3262dd20..d51c8dea 100644 --- a/lib/new_ui/otp/otp_validation_bootmsheet_widget.dart +++ b/lib/new_ui/otp/otp_validation_bootmsheet_widget.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hmg_patient_app/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:hmg_patient_app/uitl/translations_delegate_base.dart'; +import 'package:hmg_patient_app/uitl/utils.dart'; import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart'; class GenericBottomSheet extends StatefulWidget { @@ -90,7 +91,7 @@ class CustomButton extends StatelessWidget { final double borderWidth; final EdgeInsetsGeometry padding; final double fontSize; - final String fontFamily; + final String? fontFamily; final FontWeight fontWeight; final bool isDisabled; @@ -105,7 +106,7 @@ class CustomButton extends StatelessWidget { this.borderWidth = 1, this.padding = const EdgeInsets.fromLTRB(8, 16, 8, 16), this.fontSize = 16, - this.fontFamily = 'poppins', + this.fontFamily, this.fontWeight = FontWeight.w500, this.isDisabled = false, this.icon, @@ -142,7 +143,7 @@ class CustomButton extends StatelessWidget { text, style: TextStyle( fontSize: fontSize, - fontFamily: fontFamily, + fontFamily: fontFamily ?? context.fontFamily, color: isDisabled ? textColor.withOpacity(0.5) : textColor, fontWeight: fontWeight, ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 2c3a07b5..4bc38f1c 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -3,6 +3,7 @@ import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:hmg_patient_app/theme/colors.dart'; import 'package:hmg_patient_app/uitl/translations_delegate_base.dart'; +import 'package:hmg_patient_app/uitl/utils.dart'; import 'package:hmg_patient_app/widgets/buttons/secondary_button.dart'; import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart'; import 'package:hmg_patient_app/widgets/transitions/fade_page.dart'; @@ -305,120 +306,454 @@ class _CarbsState extends State { // } } -Widget inputWidget(String _labelText, String _hintText, TextEditingController? _controller, - {Function? onChange(String? value)?, String? prefix, bool isEnable = true, bool hasSelection = false, bool isBorderAllowed = true, bool isAllowLeadingIcon = false, String? leadingIcon,}) { - 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: isBorderAllowed - ? Border.all( - color: Color(0xffefefef), - width: 1, - ) - : null, - ), - child: InkWell( - onTap: hasSelection ? () {} : null, - child: Row( - children: [ - if (isAllowLeadingIcon && leadingIcon != null) - Container( - height: 40, - width: 40, - margin: EdgeInsets.only(right: 10), - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Color(0xFFEFEFF0), - borderRadius: BorderRadius.all( - Radius.circular(10), +Widget inputWidget( + String _labelText, + String _hintText, + TextEditingController? _controller, { + Function(String?)? onChange, + String? prefix, + bool isEnable = true, + bool hasSelection = false, + bool hasSelectionCustomIcon = false, + String? selectionCustomIcon, + bool isBorderAllowed = true, + bool isAllowLeadingIcon = false, + bool isLeadingCountry = false, + String? leadingIcon, + bool removePadding = false, + bool isAllowRadius = false, + List? dropdownItems, + String? selectedValue, + SelectionType? selectionType, +}) { + return Builder( + builder: (context) { + return Container( + padding: removePadding ? const EdgeInsets.only(top: 16, bottom: 16) : const EdgeInsets.symmetric(horizontal: 16, vertical: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: isAllowRadius ? BorderRadius.circular(15) : null, + color: Colors.white, + border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null, + ), + child: Row( + children: [ + if (isAllowLeadingIcon && leadingIcon != null) + Container( + height: 40, + width: 40, + margin: const EdgeInsets.only(right: 10), + padding: isLeadingCountry ? null : const EdgeInsets.all(5), + decoration: const BoxDecoration( + color: Color(0xFFEFEFF0), + borderRadius: BorderRadius.all(Radius.circular(10)), ), + child: SvgPicture.asset(leadingIcon, width: 24, height: 24), ), - child: SvgPicture.asset( - leadingIcon, - width: 24, - height: 24, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - _labelText, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff898A8D), fontFamily: 'poppins', letterSpacing: -0.2, height: 18 / 12), - ), - // if(prefix !=null) Row( - // children: [ - // Text( - // "+" + prefix, - // style: TextStyle( - // fontSize: 14, - // height: 21 / 14, - // fontWeight: FontWeight.w500, - // color: Color(0xff2E303A), - // letterSpacing: -0.56, - // ), - // ), - // ], - // ), - TextField( - enabled: isEnable, - scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, - controller: _controller, - textAlignVertical: TextAlignVertical.top, - onChanged: onChange, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w500, - color: Color(0xff2E3039), - letterSpacing: -0.2, - ), - decoration: InputDecoration( - isDense: true, - hintText: _hintText, - hintStyle: TextStyle( - fontSize: 14, - height: 21 / 16, + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 12, fontWeight: FontWeight.w500, - color: Color(0xff2E3039), + color: const Color(0xff898A8D), + fontFamily: context.fontFamily, letterSpacing: -0.2, + height: 18 / 12, ), - prefixIconConstraints: BoxConstraints(minWidth: 45), - prefixIcon: prefix == null - ? null - : Text( - "+" + prefix, - style: TextStyle( + ), + hasSelection + ? GestureDetector( + onTap: isEnable + ? () async { + if (selectionType == SelectionType.dropdown) { + final renderBox = context.findRenderObject() as RenderBox; + final offset = renderBox.localToGlobal(Offset.zero); + + final selected = await showMenu( + context: context, + position: RelativeRect.fromLTRB( + offset.dx, + offset.dy + renderBox.size.height, + offset.dx + 1, + 0, + ), + items: dropdownItems?.map((e) { + return PopupMenuItem( + value: e, + child: Text(e), + ); + }).toList() ?? + [], + ); + + if (selected != null && onChange != null) { + onChange(selected); + } + } else if (selectionType == SelectionType.calendar) { + final picked = await showDatePicker( + context: context, + + initialDate: DateTime.now(), + firstDate: DateTime(1900), + lastDate: DateTime(2100), + ); + + if (picked != null && onChange != null) { + onChange(picked.toIso8601String()); + } + } + } + : null, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + selectedValue ?? _hintText, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + fontFamily: context.fontFamily, + color: selectedValue != null ? const Color(0xff2E3039) : const Color(0xffB0B0B0), + letterSpacing: -0.2, + ), + ), + ), + if (hasSelectionCustomIcon && selectionCustomIcon != null) + SvgPicture.asset(selectionCustomIcon, width: 24, height: 24) + else + const Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ) + : TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + controller: _controller, + textAlignVertical: TextAlignVertical.top, + onChanged: onChange, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, + color: const Color(0xff2E3039), + letterSpacing: -0.2, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( fontSize: 14, - height: 21 / 14, + height: 21 / 16, + fontFamily: context.fontFamily, fontWeight: FontWeight.w500, - color: Color(0xff2E303A), + color: const Color(0xff2E3039), letterSpacing: -0.2, ), + prefixIconConstraints: const BoxConstraints(minWidth: 45), + prefixIcon: prefix == null + ? null + : Text( + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, + color: const Color(0xff2E303A), + letterSpacing: -0.2, + ), + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, ), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - ), - ], + ), + ], + ), ), - ), - if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), - ], - ), - ), + ], + ), + ); + }, ); } +// Widget inputWidget( +// String _labelText, +// String _hintText, +// TextEditingController? _controller, { +// Function(String?)? onChange, +// String? prefix, +// bool isEnable = true, +// bool hasSelection = false, +// bool hasDropDown = false, +// bool hasSelectionCustomIcon = false, +// String? selectionCustomIcon, +// bool isBorderAllowed = true, +// bool isAllowLeadingIcon = false, +// bool isLeadingCountry = false, +// String? leadingIcon, +// bool removePadding = false, +// bool isAllowRadius = true, +// List? dropdownItems, // <-- NEW +// String? selectedValue, // <-- NEW +// }) { +// return Container( +// padding: removePadding +// ? EdgeInsets.only(top: 16, bottom: 16) +// : EdgeInsets.symmetric(horizontal: 16, vertical: 15), +// alignment: Alignment.center, +// decoration: BoxDecoration( +// borderRadius: isAllowRadius ? BorderRadius.circular(15) : null, +// color: Colors.white, +// border: isBorderAllowed ? Border.all(color: Color(0xffefefef), width: 1) : null, +// ), +// child: Row( +// children: [ +// if (isAllowLeadingIcon && leadingIcon != null) +// Container( +// height: 40, +// width: 40, +// margin: EdgeInsets.only(right: 10), +// padding: isLeadingCountry ? null : EdgeInsets.all(5), +// decoration: BoxDecoration( +// color: Color(0xFFEFEFF0), +// borderRadius: BorderRadius.all(Radius.circular(10)), +// ), +// child: SvgPicture.asset(leadingIcon, width: 24, height: 24), +// ), +// Expanded( +// child: Column( +// mainAxisSize: MainAxisSize.min, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// _labelText, +// style: TextStyle( +// fontSize: 12, +// fontWeight: FontWeight.w500, +// color: Color(0xff898A8D), +// fontFamily: 'poppins', +// letterSpacing: -0.2, +// height: 18 / 12, +// ), +// ), +// hasDropDown +// ? DropdownButton( +// isExpanded: true, +// value: selectedValue, +// hint: Text(_hintText, +// style: TextStyle( +// fontSize: 14, +// height: 21 / 16, +// fontWeight: FontWeight.w500, +// color: Color(0xff2E3039), +// letterSpacing: -0.2, +// )), +// icon: SizedBox.shrink(), // hide default arrow +// underline: SizedBox.shrink(), // remove underline +// onChanged: isEnable ? onChange : null, +// items: dropdownItems?.map((String value) { +// return DropdownMenuItem( +// value: value, +// child: Text( +// value, +// style: TextStyle( +// fontSize: 14, +// height: 21 / 14, +// fontWeight: FontWeight.w500, +// color: Color(0xff2E3039), +// letterSpacing: -0.2, +// ), +// ), +// ); +// }).toList(), +// ) +// : TextField( +// enabled: isEnable, +// scrollPadding: EdgeInsets.zero, +// keyboardType: TextInputType.number, +// controller: _controller, +// textAlignVertical: TextAlignVertical.top, +// onChanged: onChange, +// style: TextStyle( +// fontSize: 14, +// height: 21 / 14, +// fontWeight: FontWeight.w500, +// color: Color(0xff2E3039), +// letterSpacing: -0.2, +// ), +// decoration: InputDecoration( +// isDense: true, +// hintText: _hintText, +// hintStyle: TextStyle( +// fontSize: 14, +// height: 21 / 16, +// fontWeight: FontWeight.w500, +// color: Color(0xff2E3039), +// letterSpacing: -0.2, +// ), +// prefixIconConstraints: BoxConstraints(minWidth: 45), +// prefixIcon: prefix == null +// ? null +// : Text( +// "+" + prefix, +// style: TextStyle( +// fontSize: 14, +// height: 21 / 14, +// fontWeight: FontWeight.w500, +// color: Color(0xff2E303A), +// letterSpacing: -0.2, +// ), +// ), +// contentPadding: EdgeInsets.zero, +// border: InputBorder.none, +// focusedBorder: InputBorder.none, +// enabledBorder: InputBorder.none, +// ), +// ), +// ], +// ), +// ), +// if (hasSelection && !hasSelectionCustomIcon) +// Icon(Icons.keyboard_arrow_down_outlined), +// if (hasSelection && hasSelectionCustomIcon) +// Container( +// height: 40, +// width: 40, +// margin: EdgeInsets.only(left: 10), +// padding: EdgeInsets.all(5), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(10)), +// ), +// child: SvgPicture.asset(selectionCustomIcon!, width: 24, height: 24), +// ), +// ], +// ), +// ); +// } + +// Widget inputWidget( +// String _labelText, +// String _hintText, +// TextEditingController? _controller, { +// Function? onChange(String? value)?, +// String? prefix, +// bool isEnable = true, +// bool hasSelection = false, +// bool hasSelectionCustomIcon = false, +// String? selectionCustomIcon, +// bool isBorderAllowed = true, +// bool isAllowLeadingIcon = false, +// bool isLeadingCountry = false, +// String? leadingIcon, +// bool removePadding = false, +// bool isAllowRadius = true, +// }) { +// return Container( +// padding: removePadding ? EdgeInsets.only(top: 16, bottom: 16) : EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), +// alignment: Alignment.center, +// decoration: BoxDecoration( +// borderRadius: isAllowRadius ? BorderRadius.circular(15) : null, +// color: Colors.white, +// border: isBorderAllowed ? Border.all(color: Color(0xffefefef), width: 1) : null, +// ), +// child: InkWell( +// onTap: hasSelection ? () {} : null, +// child: Row( +// children: [ +// if (isAllowLeadingIcon && leadingIcon != null) +// Container( +// height: 40, +// width: 40, +// margin: EdgeInsets.only(right: 10), +// padding: isLeadingCountry ? null : EdgeInsets.all(5), +// decoration: BoxDecoration( +// color: Color(0xFFEFEFF0), +// borderRadius: BorderRadius.all(Radius.circular(10)), +// ), +// child: SvgPicture.asset(leadingIcon, width: 24, height: 24), +// ), +// Expanded( +// child: Column( +// mainAxisSize: MainAxisSize.min, +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Text( +// _labelText, +// style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff898A8D), fontFamily: 'poppins', letterSpacing: -0.2, height: 18 / 12), +// ), +// // if(prefix !=null) Row( +// // children: [ +// // Text( +// // "+" + prefix, +// // style: TextStyle( +// // fontSize: 14, +// // height: 21 / 14, +// // fontWeight: FontWeight.w500, +// // color: Color(0xff2E303A), +// // letterSpacing: -0.56, +// // ), +// // ), +// // ], +// // ), +// TextField( +// enabled: isEnable, +// scrollPadding: EdgeInsets.zero, +// keyboardType: TextInputType.number, +// controller: _controller, +// textAlignVertical: TextAlignVertical.top, +// onChanged: onChange, +// style: TextStyle(fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E3039), letterSpacing: -0.2), +// decoration: InputDecoration( +// isDense: true, +// hintText: _hintText, +// hintStyle: TextStyle(fontSize: 14, height: 21 / 16, fontWeight: FontWeight.w500, color: Color(0xff2E3039), letterSpacing: -0.2), +// prefixIconConstraints: BoxConstraints(minWidth: 45), +// prefixIcon: prefix == null +// ? null +// : Text( +// "+" + prefix, +// style: TextStyle(fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E303A), letterSpacing: -0.2), +// ), +// contentPadding: EdgeInsets.zero, +// border: InputBorder.none, +// focusedBorder: InputBorder.none, +// enabledBorder: InputBorder.none, +// ), +// ), +// ], +// ), +// ), +// if (hasSelection && !hasSelectionCustomIcon) Icon(Icons.keyboard_arrow_down_outlined), +// if (hasSelection && hasSelectionCustomIcon) +// Container( +// height: 40, +// width: 40, +// margin: EdgeInsets.only(left: 10), +// padding: EdgeInsets.all(5), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(10)), +// ), +// child: SvgPicture.asset(selectionCustomIcon!, width: 24, height: 24), +// ), +// ], +// ), +// ), +// ); +// } + extension BorderedContainer on Widget { Widget get withBorderedContainer => Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), diff --git a/lib/pages/login/register_new.dart b/lib/pages/login/register_new.dart index 84ac24cf..9098c4db 100644 --- a/lib/pages/login/register_new.dart +++ b/lib/pages/login/register_new.dart @@ -2,6 +2,7 @@ import 'package:flutter/gestures.dart'; import 'package:hmg_patient_app/config/size_config.dart'; import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/new_ui/otp/otp_validation_bootmsheet_widget.dart'; +import 'package:hmg_patient_app/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:hmg_patient_app/pages/login/login-type.dart'; import 'package:hmg_patient_app/pages/login/register-info.dart'; import 'package:hmg_patient_app/pages/login/register.dart'; @@ -24,6 +25,8 @@ class RegisterNew extends StatefulWidget { class _RegisterNew extends State { final nationalIDorFile = TextEditingController(); TextEditingController phoneController = TextEditingController(); + Country selectedCountry = Country.saudiArabia; + bool isTermsAccepted = false; final int loginType = LoginType.loginType; late String mobileNo; String countryCode = '966'; @@ -56,200 +59,357 @@ class _RegisterNew extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).register, - isShowDecPage: false, - isShowAppBar: true, - isshowBackButton: true, - showNewAppBar: true, - backgroundColor: Color(0xffF8F8F8), - showNewAppBarTitle: false, - showDropDown: true, - isShowLanguageChanger: true, - appBarIcons: [], - dropDownList: [], - dropDownIndexChange: (value) { - Utils.changeAppLanguage(context: context); - }, - body: SingleChildScrollView( - child: Container( - height: SizeConfig.realScreenHeight! * .9, - width: SizeConfig.realScreenWidth, - child: Column(children: [ - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 20, right: 20, top: 12), - child: Row( - children: [ - Expanded( - child: showProgress( - title: TranslationBase.of(context).enterDetails, - status: _currentIndex == 0 - ? TranslationBase.of(context).inPrgress - : _currentIndex > 0 - ? TranslationBase.of(context).completed - : TranslationBase.of(context).locked, - color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green, - ), + appBarTitle: TranslationBase.of(context).register, + isShowDecPage: false, + isShowAppBar: true, + isshowBackButton: true, + showNewAppBar: true, + backgroundColor: Color(0xffF8F8F8), + showNewAppBarTitle: false, + showDropDown: true, + isShowLanguageChanger: true, + appBarIcons: [], + dropDownList: [], + resizeToAvoidBottomInset: true, + dropDownIndexChange: (value) { + Utils.changeAppLanguage(context: context); + }, + // body: SingleChildScrollView( + // child: Container( + // height: SizeConfig.realScreenHeight! * .9, + // width: SizeConfig.realScreenWidth, + // child: Column(children: [ + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(left: 20, right: 20, top: 12), + // child: Row( + // children: [ + // Expanded( + // child: showProgress( + // title: TranslationBase.of(context).enterDetails, + // 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: [ + // Register( + // changePageViewIndex: changePageViewIndex, + // ), + // + // RegisterInfo( + // changePageViewIndex: changePageViewIndex, + // ), + // RegisterInfo(changePageViewIndex: changePageViewIndex, page: 2), + // // NewEReferralStepOnePage( + // // changePageViewIndex: changePageViewIndex, + // // createEReferralRequestModel: createEReferralRequestModel, + // // ), + // // NewEReferralStepTowPage( + // // changePageViewIndex: changePageViewIndex, + // // createEReferralRequestModel: createEReferralRequestModel, + // // ), + // // NewEReferralStepThreePage( + // // changePageViewIndex: changePageViewIndex, + // // createEReferralRequestModel: createEReferralRequestModel, + // // ), + // ], + // ), + // ), + // ]), + // ), + // ), + + body: SafeArea( + child: SingleChildScrollView( + reverse: true, + padding: EdgeInsets.only( + left: 24, + right: 24, + // bottom: MediaQuery.of(context).viewInsets.bottom , + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Utils.showLottie( + context: context, + assetPath: 'assets/animations/lottie/register.json', + width: 238, + repeat: true, + ), + SizedBox(height: 8), + Text( + TranslationBase.of(context).prepareToElevate, + style: TextStyle( + fontSize: 32, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.4, + height: 47 / 32, ), - 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, + ), + SizedBox(height: 24), + Directionality( + textDirection: TextDirection.ltr, + child: Container( + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)), + padding: EdgeInsets.only(left: 16, right: 16), + child: Column( + children: [ + inputWidget( + TranslationBase.of(context).country, + "Kingdom Of Saudi Arabia", + nationalIDorFile, + isEnable: true, + prefix: null, + hasSelection: true, + dropdownItems: Country.values.map((e) => e.displayName).toList(), + selectedValue: selectedCountry.displayName, + selectionType: SelectionType.dropdown, + onChange: (val) { + if (val != null) { + setState(() { + selectedCountry = CountryExtension.fromDisplayName(val); + }); + } + }, + isBorderAllowed: false, + isAllowLeadingIcon: true, + hasSelectionCustomIcon: true, + removePadding: true, + isLeadingCountry: true, + isAllowRadius: false, + selectionCustomIcon: "assets/images/svg/arrow-down.svg", + leadingIcon: selectedCountry.iconPath, + ), + Divider(height: 1), + inputWidget(TranslationBase.of(context).nationalIdNumber, "1xxxxxxxx", nationalIDorFile, + isEnable: true, + prefix: null, + removePadding: true, + isAllowRadius: false, + hasSelection: false, + isBorderAllowed: false, + isAllowLeadingIcon: true, + leadingIcon: "assets/images/svg/student-card.svg", onChange: (value) { + print(value); + }), + Divider(height: 1), + inputWidget(TranslationBase.of(context).dob, "11 July, 1994", nationalIDorFile, + isEnable: true, + prefix: null, + hasSelection: true, + removePadding: true, + isBorderAllowed: false, + isAllowLeadingIcon: true, + hasSelectionCustomIcon: true, + selectionType: SelectionType.calendar, + selectionCustomIcon: "assets/images/svg/calendar.svg", + leadingIcon: "assets/images/svg/birthday-cake.svg", onChange: (value) { + print("=========== " + value!); + }), + ], ), ), - 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: [ - Register( - changePageViewIndex: changePageViewIndex, - ), - - RegisterInfo( - changePageViewIndex: changePageViewIndex, + ), + SizedBox(height: 25), + GestureDetector( + onTap: () { + setState(() { + isTermsAccepted = !isTermsAccepted; + }); + }, + child: Row( + children: [ + AnimatedContainer( + duration: const Duration(milliseconds: 200), + height: 24, + width: 24, + decoration: BoxDecoration( + color: isTermsAccepted ? const Color(0xFFE92227) : Colors.transparent, + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: isTermsAccepted ? const Color(0xFFE92227) : Colors.grey, + width: 2, + ), + ), + child: isTermsAccepted ? const Icon(Icons.check, size: 16, color: Colors.white) : null, + ), + const SizedBox(width: 12), + Expanded( + child: Text( + TranslationBase.of(context).iAcceptTermsConditions, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Color(0xFF2E3039), + ), + ), + ), + ], ), - RegisterInfo(changePageViewIndex: changePageViewIndex, page: 2), - // NewEReferralStepOnePage( - // changePageViewIndex: changePageViewIndex, - // createEReferralRequestModel: createEReferralRequestModel, - // ), - // NewEReferralStepTowPage( - // changePageViewIndex: changePageViewIndex, - // createEReferralRequestModel: createEReferralRequestModel, - // ), - // NewEReferralStepThreePage( - // changePageViewIndex: changePageViewIndex, - // createEReferralRequestModel: createEReferralRequestModel, - // ), - ], - ), - ), - ]), - ), - ), - bottomSheet: Container( - decoration: BoxDecoration(color: Color(0xffF8F8F8)), - // height: 160, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: CustomButton( - text: TranslationBase.of(context).login, - icon: "assets/images/svg/login1.svg", - onPressed: () { - // bool isValid = validateIqama(nationIdController.text); - // print("Iqama is valid: $isValid"); - if (true) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - isDismissible: false, - backgroundColor: Colors.transparent, - builder: (bottomSheetContext) => Padding( - padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom), - child: SingleChildScrollView( - child: GenericBottomSheet( - countryCode: "966", - initialPhoneNumber: "", - textController: phoneController, // Assumed to be a TextEditingController - buttons: [ - Padding( - padding: const EdgeInsets.only(bottom: 10), - child: CustomButton( - text: "Send me OTP on SMS", - onPressed: () { - Utils.onOtpBtnPressed(OTPType.sms, phoneController); - }, - backgroundColor: Colors.red, - borderColor: Colors.red, - textColor: Colors.white, - icon: "assets/images/svg/message.svg", - ), - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: AppText( - "OR", - fontSize: 16, - fontFamily: 'poppins', - color: Color(0xFF2E3039), - fontWeight: FontWeight.w500, - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(bottom: 10), - child: CustomButton( - text: "Send me OTP on WhatsApp", - onPressed: () { - Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController); - }, - backgroundColor: Colors.white, - borderColor: Color(0xFF2E3039), - textColor: Color(0xFF2E3039), - icon: "assets/images/svg/whatsapp.svg", - ), - ), - ], - ), + ), + SizedBox(height: 25), + CustomButton( + text: TranslationBase.of(context).register, + icon: "assets/images/svg/note-edit.svg", + onPressed: () { + bool isValid = Utils.validateIqama(nationalIDorFile.text); + if (isValid) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + isDismissible: false, + backgroundColor: Colors.transparent, + builder: (bottomSheetContext) => Padding( + padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom), + child: SingleChildScrollView( + child: GenericBottomSheet( + countryCode: "966", + initialPhoneNumber: "", + textController: phoneController, + buttons: [ + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: CustomButton( + text: "Send me OTP on SMS", + onPressed: () { + int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController); + // if (val != null) checkUserAuthentication(val); + }, + backgroundColor: Colors.red, + borderColor: Colors.red, + textColor: Colors.white, + icon: "assets/images/svg/message.svg", + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AppText( + "OR", + fontSize: 16, + fontFamily: 'poppins', + color: Color(0xFF2E3039), + fontWeight: FontWeight.w500, ), - )); - } else { - Utils.showErrorToast("Please enter a valid Iqama number."); - } - }), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: CustomButton( + text: "Send me OTP on WhatsApp", + onPressed: () { + int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController); + // if (val != null) checkUserAuthentication(val); + }, + backgroundColor: Colors.white, + borderColor: Color(0xFF2E3039), + textColor: Color(0xFF2E3039), + icon: "assets/images/svg/whatsapp.svg", + ), + ), + ], + ), + ), + ), + ); + } else { + Utils.showErrorToast("Please enter a valid Iqama number."); + } + }, + fontFamily: context.fontFamily, + ), + SizedBox(height: 14), + Center( + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: TextStyle( + color: Colors.black, + fontSize: 16, + height: 26 / 16, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, + ), + children: [ + TextSpan( + text: TranslationBase.of(context).alreadyHaveAccount, + style: TextStyle( + fontFamily: context.fontFamily, + ), + ), + TextSpan(text: " "), + TextSpan( + text: TranslationBase.of(context).loginNow, + style: TextStyle( + color: Colors.red, + fontSize: 16, + height: 26 / 16, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + // Navigator.of(context).push(FadePage(page: RegisterNew())); + // locator().loginRegistration.visited_alhabib_group(true); + }, + ), + ], + ), ), ), + SizedBox(height: 30), ], ), - - SizedBox( - height: 30, - ) - ], - ), - ), - ); + ), + )); } Widget showProgress({String? title, String? status, Color? color, bool isNeedBorder = true}) { diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index f90e475f..e0405520 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -114,180 +114,170 @@ class _WelcomeLogin extends State { isShowLanguageChanger: true, appBarIcons: [], dropDownList: [], + resizeToAvoidBottomInset: true, dropDownIndexChange: (value) { Utils.changeAppLanguage(context: context); }, - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 24), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Utils.showLottie(context: context, assetPath: 'assets/animations/lottie/login.json', width: 238, repeat: true), - // SvgPicture.asset("assets/images/new/hmg_icon.svg", height: 62, width: 62), - Spacer(flex: 1), - Text( - TranslationBase.of(context).welcomeToDrSulaiman, - style: TextStyle( - fontSize: 32, - fontFamily: (projectViewModel.currentLanguage == 'ar' ? 'Cairo' : 'Poppins'), - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.4, - height: 47 / 32, + body: SafeArea( + child: SingleChildScrollView( + reverse: true, + padding: EdgeInsets.only( + left: 24, + right: 24, + // bottom: MediaQuery.of(context).viewInsets.bottom , + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Utils.showLottie( + context: context, + assetPath: 'assets/animations/lottie/login.json', + width: 238, + repeat: true, ), - ), - SizedBox(height: 20), - Directionality( - textDirection: TextDirection.ltr, - child: inputWidget("National ID. or File No", "1xxxxxxxx", nationIdController, - isEnable: true, prefix: null, hasSelection: false, isBorderAllowed: false, isAllowLeadingIcon: true, leadingIcon: "assets/images/svg/student-card.svg"), - ), - SizedBox(height: 15), - Spacer(flex: 1), - ], - ), - ), - bottomSheet: Container( - decoration: BoxDecoration(color: Color(0xffF8F8F8)), - // height: 160, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), - child: CustomButton( - text: TranslationBase.of(context).login, - icon: "assets/images/svg/login1.svg", - onPressed: () { - bool isValid = Utils.validateIqama(nationIdController.text); - print("Iqama is valid: $isValid"); - if (isValid) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - isDismissible: false, - backgroundColor: Colors.transparent, - builder: (bottomSheetContext) => Padding( - padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom), - child: SingleChildScrollView( - child: GenericBottomSheet( - countryCode: "966", - initialPhoneNumber: "", - textController: phoneController, // Assumed to be a TextEditingController - buttons: [ - Padding( - padding: const EdgeInsets.only(bottom: 10), - child: CustomButton( - text: "Send me OTP on SMS", - onPressed: () { - int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController); - if (val != null) { - checkUserAuthentication(val); - } - }, - backgroundColor: Colors.red, - borderColor: Colors.red, - textColor: Colors.white, - icon: "assets/images/svg/message.svg", - ), - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: AppText( - "OR", - fontSize: 16, - fontFamily: 'poppins', - color: Color(0xFF2E3039), - fontWeight: FontWeight.w500, - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(bottom: 10), - child: CustomButton( - text: "Send me OTP on WhatsApp", - onPressed: () { - int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController); - if (val != null) { - checkUserAuthentication(val); - } - }, - backgroundColor: Colors.white, - borderColor: Color(0xFF2E3039), - textColor: Color(0xFF2E3039), - icon: "assets/images/svg/whatsapp.svg", - ), - ), - ], - ), - ), - )); - } else { - Utils.showErrorToast("Please enter a valid Iqama number."); - } - }), - ), + SizedBox(height: 150), + Text( + TranslationBase.of(context).welcomeToDrSulaiman, + style: TextStyle( + fontSize: 32, + fontFamily: (projectViewModel.currentLanguage == 'ar' ? 'Cairo' : 'Poppins'), + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.4, + height: 47 / 32, ), - ], - ), - SizedBox( - height: 10, - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - RichText( - textAlign: TextAlign.center, - text: TextSpan( - style: TextStyle( - color: Colors.black, - fontSize: 16, - height: 26 / 16, - fontFamily: 'poppins', - fontWeight: FontWeight.w500, - ), - children: [ - TextSpan( - text: TranslationBase.of(context).dontHaveAccount, - ), - TextSpan(text: " "), - TextSpan( - text: TranslationBase.of(context).registerNow, - style: const TextStyle( - color: Colors.red, - fontSize: 16, - height: 26 / 16, - fontFamily: 'poppins', - fontWeight: FontWeight.w500, + ), + SizedBox(height: 32), + Directionality( + textDirection: TextDirection.ltr, + child: inputWidget( + "National ID. or File No", + "1xxxxxxxx", + nationIdController, + isEnable: true, + prefix: null, + hasSelection: false, + isBorderAllowed: false, + isAllowLeadingIcon: true, + leadingIcon: "assets/images/svg/student-card.svg", + ), + ), + SizedBox(height: 16), + CustomButton( + text: TranslationBase.of(context).login, + icon: "assets/images/svg/login1.svg", + onPressed: () { + bool isValid = Utils.validateIqama(nationIdController.text); + if (isValid) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + isDismissible: false, + backgroundColor: Colors.transparent, + builder: (bottomSheetContext) => Padding( + padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom), + child: SingleChildScrollView( + child: GenericBottomSheet( + countryCode: "966", + initialPhoneNumber: "", + textController: phoneController, + buttons: [ + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: CustomButton( + text: "Send me OTP on SMS", + onPressed: () { + int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController); + if (val != null) checkUserAuthentication(val); + }, + backgroundColor: Colors.red, + borderColor: Colors.red, + textColor: Colors.white, + icon: "assets/images/svg/message.svg", + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AppText( + "OR", + fontSize: 16, + fontFamily: 'poppins', + color: Color(0xFF2E3039), + fontWeight: FontWeight.w500, + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: CustomButton( + text: "Send me OTP on WhatsApp", + + onPressed: () { + int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController); + if (val != null) checkUserAuthentication(val); + }, + backgroundColor: Colors.white, + borderColor: Color(0xFF2E3039), + textColor: Color(0xFF2E3039), + icon: "assets/images/svg/whatsapp.svg", + ), + ), + ], ), - recognizer: TapGestureRecognizer() - ..onTap = () { - Navigator.of(context).push(FadePage(page: RegisterNew())); - locator().loginRegistration.visited_alhabib_group(true); - }, ), - ], + ), + ); + } else { + Utils.showErrorToast("Please enter a valid Iqama number."); + } + }, + ), + SizedBox(height: 14), + Center( + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: TextStyle( + color: Colors.black, + fontSize: 16, + height: 26 / 16, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, ), + children: [ + TextSpan( + text: TranslationBase.of(context).dontHaveAccount, + style: TextStyle( + fontFamily: context.fontFamily, + )), + TextSpan(text: " "), + TextSpan( + text: TranslationBase.of(context).registerNow, + style: TextStyle( + color: Colors.red, + fontSize: 16, + height: 26 / 16, + fontFamily: context.fontFamily, + fontWeight: FontWeight.w500, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.of(context).push(FadePage(page: RegisterNew())); + locator().loginRegistration.visited_alhabib_group(true); + }, + ), + ], ), - ], + ), ), - ), - SizedBox( - height: 30, - ) - ], + SizedBox(height: 30), + ], + ), ), ), ); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b19943a2..bea13750 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -3475,7 +3475,10 @@ class TranslationBase { String get liveCareTermsConditions48 => localizedValues["liveCareTermsConditions48"][locale.languageCode]; String get clickPrivacyPolicy => localizedValues["clickPrivacyPolicy"][locale.languageCode]; String get welcomeToDrSulaiman => localizedValues["welcomeToDrSulaiman"][locale.languageCode]; + String get prepareToElevate => localizedValues["prepareToElevate"][locale.languageCode]; String get dontHaveAccount => localizedValues["dontHaveAccount"][locale.languageCode]; + String get alreadyHaveAccount => localizedValues["alreadyHaveAccount"][locale.languageCode]; + String get loginNow => localizedValues["loginNow"][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index e18573eb..9c1e19ef 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -68,6 +68,10 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); enum OTPType { sms, whatsapp } +enum Country { saudiArabia, unitedArabEmirates } + +enum SelectionType { dropdown, calendar } + class Utils { static int? onOtpBtnPressed(OTPType type, TextEditingController controller) { if (controller.text.isEmpty) { @@ -1152,6 +1156,54 @@ extension TextToRichTextWithIcon on Text { } } +extension WidgetPaddingExtensions on Widget { + Widget withHorizontalPadding([double padding = 16.0]) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: padding), + child: this, + ); + } +} + +extension CountryExtension on Country { + String get displayName { + switch (this) { + case Country.saudiArabia: + return "Kingdom Of Saudi Arabia"; + case Country.unitedArabEmirates: + return "United Arab Emirates"; + } + } + + String get iconPath { + switch (this) { + case Country.saudiArabia: + return "assets/images/svg/ksa.svg"; + case Country.unitedArabEmirates: + return "assets/images/svg/uae.svg"; + } + } + + static Country fromDisplayName(String name) { + switch (name) { + case "Kingdom Of Saudi Arabia": + return Country.saudiArabia; + case "United Arab Emirates": + return Country.unitedArabEmirates; + default: + throw Exception("Invalid country name"); + } + } +} + + +extension FontFamilyExtension on BuildContext { + String get fontFamily { + final language = read().currentLanguage; + return language == 'ar' ? 'Cairo' : 'Poppins'; + } +} + /* userBoard.asMap().map((i, element) => MapEntry(i, Stack( GestureDetector(onTap: () { diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 2095fc0f..9f89b1dd 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -86,6 +86,7 @@ class AppScaffold extends StatefulWidget { final bool isshowBackButton; final Widget? customAppBar; final bool isShowLanguageChanger; + final bool resizeToAvoidBottomInset; AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; @@ -135,7 +136,9 @@ class AppScaffold extends StatefulWidget { this.changeCurrentTab, this.currentTab, this.isShowPharmacyAppbar = false, - this.isShowLanguageChanger = false}); + this.isShowLanguageChanger = false, + this.resizeToAvoidBottomInset = false + }); @override _AppScaffoldState createState() => _AppScaffoldState(); @@ -225,7 +228,7 @@ class _AppScaffoldState extends State { return Scaffold( backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color, - +resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset, // appBar: widget.isShowPharmacyAppbar // ? pharmacyAppbar() // : widget.isShowAppBar @@ -440,7 +443,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { ), if (showDropDown! && isShowLanguageChanger) Padding( - padding: EdgeInsets.symmetric(horizontal: 20), + padding: EdgeInsets.symmetric(horizontal: 24), child: Directionality( textDirection: TextDirection.ltr, child: LanguageSelector(