translation & register Design changes.

merge-update-with-lab-changes
Aamir Muhammad 5 months ago committed by haroon amjad
parent 2d5b4342a1
commit 16b37b847d

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.60372 8.55529C6.7256 8.71666 7.08951 9.1984 7.30624 9.47611C7.74031 10.0323 8.33342 10.7714 8.97323 11.5083C9.61627 12.2489 10.2918 12.9702 10.8919 13.5005C11.1928 13.7663 11.4571 13.9684 11.6753 14.0999C11.8804 14.2235 12.0016 14.2493 12.0016 14.2493C12.0016 14.2493 12.1192 14.2235 12.3244 14.0999C12.5425 13.9684 12.8068 13.7663 13.1078 13.5005C13.7079 12.9702 14.3834 12.2489 15.0264 11.5083C15.6662 10.7714 16.2593 10.0323 16.6934 9.47608C16.9101 9.19837 17.2735 8.7173 17.3954 8.55593C17.6411 8.22241 18.1111 8.15047 18.4446 8.3961C18.7781 8.64173 18.8494 9.11123 18.6037 9.44476L18.6018 9.4473C18.474 9.61655 18.0971 10.1156 17.8759 10.3989C17.4321 10.9677 16.8216 11.7286 16.1591 12.4917C15.4997 13.2511 14.7741 14.0298 14.101 14.6245C13.7653 14.9212 13.425 15.1879 13.0988 15.3845C12.7932 15.5687 12.4063 15.75 11.9998 15.75C11.5933 15.75 11.2064 15.5687 10.9008 15.3845C10.5747 15.1879 10.2344 14.9212 9.89869 14.6245C9.22557 14.0298 8.4999 13.2511 7.84058 12.4917C7.17803 11.7286 6.5676 10.9677 6.12372 10.399C5.90243 10.1154 5.52551 9.61637 5.39793 9.44747L5.39628 9.44528C5.15064 9.11176 5.22154 8.64179 5.55506 8.39615C5.88857 8.15053 6.35808 8.22179 6.60372 8.55529Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4418 1.49922C11.5841 1.34069 11.787 1.25018 12 1.25018C12.213 1.25018 12.4159 1.34069 12.5582 1.49922L12.6312 1.58237C12.6754 1.6333 12.7375 1.70604 12.8118 1.79563C12.9597 1.97402 13.1585 2.22288 13.3589 2.50157C13.5574 2.77755 13.7682 3.09762 13.9325 3.41677C14.0843 3.71167 14.25 4.10538 14.25 4.50012C14.25 5.47979 13.6239 6.31322 12.75 6.6221V8.24982H17.6667C19.5547 8.24982 21.25 9.61943 21.25 11.4998C21.25 12.632 20.6354 13.5791 19.7341 14.1534L19.2051 16.7737C18.9507 18.0334 18.7469 19.0427 18.4913 19.8286C18.2273 20.6402 17.8824 21.3005 17.2923 21.8068C16.6977 22.3169 16.0038 22.5423 15.1841 22.6484C14.3991 22.7499 13.4201 22.7499 12.2119 22.7498H11.7881C10.5799 22.7499 9.60094 22.7499 8.81598 22.6484C7.9962 22.5423 7.30238 22.3169 6.70776 21.8068C6.11764 21.3005 5.77272 20.6402 5.50874 19.8286C5.25312 19.0427 5.04935 18.0334 4.79499 16.7737L4.26591 14.1535C3.36464 13.5791 2.75 12.6321 2.75 11.4998C2.75 9.61943 4.44528 8.24982 6.33333 8.24982H11.25V6.6221C10.3761 6.31322 9.75 5.47979 9.75 4.50012C9.75 4.10538 9.91573 3.71167 10.0675 3.41677C10.2318 3.09762 10.4426 2.77755 10.6411 2.50157C10.8415 2.22288 11.0403 1.97402 11.1882 1.79563C11.2625 1.70604 11.3246 1.6333 11.3688 1.58237L11.4418 1.49922ZM5.912 14.727L6.25607 16.431C6.52182 17.7471 6.70955 18.6709 6.93519 19.3646C7.15557 20.0422 7.38603 20.4123 7.68445 20.6683C7.97836 20.9205 8.35454 21.0762 9.00836 21.1607C9.68599 21.2484 10.5678 21.2498 11.839 21.2498H12.161C13.4323 21.2498 14.3141 21.2484 14.9917 21.1607C15.6455 21.0762 16.0217 20.9205 16.3156 20.6683C16.614 20.4123 16.8445 20.0422 17.0649 19.3646C17.2905 18.6709 17.4782 17.7471 17.744 16.431L18.0881 14.727C17.9491 14.7421 17.8084 14.7498 17.6667 14.7498C16.5766 14.7498 15.5238 14.2969 14.8333 13.5415C14.1429 14.2969 13.0901 14.7498 12 14.7498C10.9099 14.7498 9.85714 14.2969 9.16667 13.5415C8.47619 14.2969 7.42339 14.7498 6.33333 14.7498C6.19159 14.7498 6.05093 14.7421 5.912 14.727ZM6.33333 9.74982H17.6667C18.9082 9.74982 19.75 10.6188 19.75 11.4998C19.75 12.3809 18.9082 13.2498 17.6667 13.2498C16.5717 13.2498 15.733 12.5653 15.5642 11.8317C15.4859 11.4911 15.1828 11.2498 14.8333 11.2498C14.4839 11.2498 14.1808 11.4911 14.1024 11.8317C13.9337 12.5653 13.095 13.2498 12 13.2498C10.905 13.2498 10.0663 12.5653 9.89757 11.8317C9.81923 11.4911 9.5161 11.2498 9.16667 11.2498C8.81723 11.2498 8.5141 11.4911 8.43576 11.8317C8.26698 12.5653 7.42833 13.2498 6.33333 13.2498C5.09177 13.2498 4.25 12.3809 4.25 11.4998C4.25 10.6188 5.09177 9.74982 6.33333 9.74982ZM12.0162 5.24999L12 5.24982L11.9838 5.24999C11.577 5.24138 11.25 4.90872 11.25 4.49991C11.2504 4.49574 11.2533 4.46101 11.277 4.38874C11.3022 4.31207 11.343 4.21637 11.4012 4.10328C11.5182 3.87602 11.6823 3.62287 11.8588 3.37739C11.9061 3.31174 11.9534 3.2477 12 3.18602C12.0465 3.2477 12.0938 3.31174 12.1411 3.37739C12.3176 3.62287 12.4818 3.87602 12.5987 4.10328C12.6569 4.21637 12.6977 4.31207 12.7229 4.38874C12.7466 4.46101 12.7496 4.49599 12.75 4.50016C12.75 4.90895 12.4229 5.24136 12.0162 5.24999Z" fill="#8F9AA3"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -0,0 +1,8 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 12C7.44772 12 7 12.4477 7 13C7 13.5523 7.44772 14 8 14H8.00897C8.56126 14 9.00897 13.5523 9.00897 13C9.00897 12.4477 8.56126 12 8.00897 12H8Z" fill="#2E3039"/>
<path d="M11.9955 12C11.4432 12 10.9955 12.4477 10.9955 13C10.9955 13.5523 11.4432 14 11.9955 14H12.0045C12.5568 14 13.0045 13.5523 13.0045 13C13.0045 12.4477 12.5568 12 12.0045 12H11.9955Z" fill="#2E3039"/>
<path d="M15.991 12C15.4387 12 14.991 12.4477 14.991 13C14.991 13.5523 15.4387 14 15.991 14H16C16.5523 14 17 13.5523 17 13C17 12.4477 16.5523 12 16 12H15.991Z" fill="#2E3039"/>
<path d="M8 16C7.44772 16 7 16.4477 7 17C7 17.5523 7.44772 18 8 18H8.00897C8.56126 18 9.00897 17.5523 9.00897 17C9.00897 16.4477 8.56126 16 8.00897 16H8Z" fill="#2E3039"/>
<path d="M11.9955 16C11.4432 16 10.9955 16.4477 10.9955 17C10.9955 17.5523 11.4432 18 11.9955 18H12.0045C12.5568 18 13.0045 17.5523 13.0045 17C13.0045 16.4477 12.5568 16 12.0045 16H11.9955Z" fill="#2E3039"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 2C6.75 1.58579 6.41421 1.25 6 1.25C5.58579 1.25 5.25 1.58579 5.25 2V2.63479C4.44524 2.86288 3.7665 3.2336 3.20154 3.84436C2.42363 4.68535 2.07785 5.74792 1.91225 7.07951C1.74998 8.3843 1.74999 10.0565 1.75 12.19L1.75 12.81C1.74999 14.9435 1.74998 16.6157 1.91225 17.9205C2.07785 19.2521 2.42363 20.3147 3.20154 21.1556C3.98714 22.0049 4.99276 22.3901 6.25129 22.573C7.46932 22.75 9.02555 22.75 10.9892 22.75H13.0108C14.9745 22.75 16.5307 22.75 17.7487 22.573C19.0072 22.3901 20.0129 22.0049 20.7985 21.1556C21.5764 20.3147 21.9222 19.2521 22.0878 17.9205C22.25 16.6157 22.25 14.9435 22.25 12.8099V12.1901C22.25 10.0565 22.25 8.38431 22.0878 7.07951C21.9222 5.74792 21.5764 4.68535 20.7985 3.84436C20.2335 3.2336 19.5548 2.86288 18.75 2.63479V2C18.75 1.58579 18.4142 1.25 18 1.25C17.5858 1.25 17.25 1.58579 17.25 2V2.36589C16.1139 2.24997 14.716 2.24998 13.0108 2.25L10.9892 2.25C9.28402 2.24998 7.88606 2.24997 6.75 2.36589V2ZM5.2786 4.20584C5.36806 4.51998 5.65717 4.75 6 4.75C6.41421 4.75 6.75 4.41421 6.75 4V3.87459C7.81101 3.75156 9.18237 3.75 11.05 3.75L12.95 3.75C14.8176 3.75 16.189 3.75156 17.25 3.87459V4C17.25 4.41421 17.5858 4.75 18 4.75C18.3428 4.75 18.6319 4.51998 18.7214 4.20585C19.1287 4.36791 19.438 4.58256 19.6973 4.86292C20.1704 5.37439 20.4505 6.07588 20.5982 7.25637C20.5661 7.25217 20.5333 7.25 20.5 7.25L3.5 7.25C3.46672 7.25 3.43395 7.25217 3.40181 7.25637C3.54952 6.07588 3.82959 5.37439 4.30269 4.86292C4.56203 4.58256 4.87129 4.36791 5.2786 4.20584ZM3.29013 8.72024C3.25056 9.68315 3.25 10.8363 3.25 12.2432V12.7568C3.25 14.9551 3.25137 16.5339 3.40078 17.7354C3.54821 18.9208 3.82849 19.6244 4.30269 20.1371C4.76921 20.6414 5.39728 20.9331 6.46704 21.0886C7.56476 21.2481 9.01188 21.25 11.05 21.25H12.95C14.9881 21.25 16.4352 21.2481 17.533 21.0886C18.6027 20.9331 19.2308 20.6414 19.6973 20.1371C20.1715 19.6244 20.4518 18.9208 20.5992 17.7354C20.7486 16.5339 20.75 14.9551 20.75 12.7568V12.2432C20.75 10.8363 20.7494 9.68315 20.7099 8.72024C20.6433 8.73961 20.5728 8.75 20.5 8.75L3.5 8.75C3.42715 8.75 3.35673 8.73961 3.29013 8.72024Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 478 KiB

@ -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": "Dont have an account?", "ar": "ليس لديك حساب؟"}
"dontHaveAccount": {"en": "Dont 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": "تسجيل الدخول الآن"}
};

@ -201,6 +201,7 @@ class _MyApp extends State<MyApp> {
const Locale('ar', ''), // Arabic
const Locale('en', ''), // English
],
theme: Provider.of<ThemeNotifier>(context).getTheme(),
initialRoute: SPLASH,
// initialRoute: CALL_PAGE,

@ -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,
),

@ -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<Carbs> {
// }
}
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<String>? 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<String>(
context: context,
position: RelativeRect.fromLTRB(
offset.dx,
offset.dy + renderBox.size.height,
offset.dx + 1,
0,
),
items: dropdownItems?.map((e) {
return PopupMenuItem<String>(
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<String>? 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<String>(
// 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<String>(
// 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),

@ -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<RegisterNew> {
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<RegisterNew> {
@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: <Widget>[
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: <Widget>[
// 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: <Widget>[
// 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: <Widget>[
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: <Widget>[
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: <Widget>[
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>[
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<GAnalytics>().loginRegistration.visited_alhabib_group(true);
},
),
],
),
),
),
SizedBox(height: 30),
],
),
SizedBox(
height: 30,
)
],
),
),
);
),
));
}
Widget showProgress({String? title, String? status, Color? color, bool isNeedBorder = true}) {

@ -114,180 +114,170 @@ class _WelcomeLogin extends State<WelcomeLogin> {
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: <Widget>[
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: <Widget>[
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: <Widget>[
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>[
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<GAnalytics>().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>[
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<GAnalytics>().loginRegistration.visited_alhabib_group(true);
},
),
],
),
],
),
),
),
SizedBox(
height: 30,
)
],
SizedBox(height: 30),
],
),
),
),
);

@ -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];
String get readMore => localizedValues["readMore"][locale.languageCode];
String get showLess => localizedValues["showLess"][locale.languageCode];

@ -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) {
@ -1142,6 +1146,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<ProjectViewModel>().currentLanguage;
return language == 'ar' ? 'Cairo' : 'Poppins';
}
}
/*
userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () {

@ -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<AppScaffold> {
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(

Loading…
Cancel
Save