font changes

merge-update-with-lab-changes
Aamir Muhammad 4 months ago committed by haroon amjad
parent 6b96b6fc9e
commit 23fc89b40a

@ -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="M16.3951 9.46315C16.6916 9.6815 16.7549 10.0988 16.5366 10.3953C16.367 10.6256 16.1974 10.8445 16.0486 11.0351C15.7516 11.4157 15.3427 11.9254 14.8985 12.437C14.4571 12.9453 13.9677 13.4708 13.5109 13.8745C13.2832 14.0757 13.0479 14.2607 12.8185 14.399C12.6073 14.5263 12.3172 14.6666 11.9998 14.6666C11.6823 14.6666 11.3922 14.5263 11.181 14.399C10.9516 14.2607 10.7163 14.0757 10.4886 13.8745C10.0318 13.4708 9.54242 12.9453 9.10106 12.437C8.65682 11.9254 8.24794 11.4157 7.95093 11.0351C7.80215 10.8445 7.63252 10.6256 7.46293 10.3953C7.24458 10.0988 7.30791 9.6815 7.60437 9.46315C7.72355 9.37538 7.86225 9.33314 7.99972 9.33325L15.9998 9.33325C16.1373 9.33314 16.276 9.37538 16.3951 9.46315Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 827 B

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.67813 26.7442C4.67813 26.7442 5.79663 26.7362 6.58579 26.7362L12.5626 26.765C13.2772 26.765 13.8707 26.0068 13.9036 24.9121L13.9101 19.9214C13.9101 18.8573 14.3861 18.0246 15.124 17.9771L16.9571 17.9622C17.6959 18.0075 18.2033 18.8483 18.2033 19.908L18.1983 24.9267C18.2294 26.0208 18.7284 26.7355 19.4455 26.7355L27.4924 26.7576L27.5074 20.5883C27.5074 19.5274 26.9969 18.703 26.2546 18.6568L23.0234 18.6403C22.3088 18.6403 21.7461 17.8861 21.7144 16.7901L21.7017 15.1219C21.7374 14.0278 22.3026 13.2752 23.0191 13.2752L26.2686 13.2845C27.0068 13.237 27.4884 12.3654 27.4884 11.3064L27.4962 3.60826C27.4962 3.60826 26.6598 5.07839 25.0066 5.16378L19.5411 5.15881C18.829 5.15881 18.2325 5.93502 18.2002 7.02854V11.9727C18.1666 13.0653 17.6074 13.8381 16.8915 13.8381L15.238 13.8253C14.5209 13.8253 13.9474 13.0777 13.9151 11.9885L13.9194 6.98973C13.8884 5.89497 13.3192 5.15788 12.6036 5.15788L4.67254 5.1616L4.67036 11.3092C4.67036 12.371 5.16748 13.2218 5.90724 13.2708L9.1571 13.2571C9.89221 13.3053 10.4129 14.1811 10.4129 15.2374L10.403 16.6607C10.403 17.7219 9.90059 18.5714 9.16238 18.6198L5.90724 18.6121C5.16685 18.6624 4.67036 19.5031 4.67036 20.5622L4.67813 26.7442ZM32 3.17482V28.8897C31.9599 30.6237 30.4879 31.9669 28.6923 31.9998H3.29336C2.44731 32.0095 1.63063 31.6901 1.01602 31.109C0.401403 30.5279 0.03705 29.7307 0 28.8859L0.0021713 3.12235C0.0399629 2.27665 0.404663 1.4786 1.01948 0.896227C1.63429 0.313857 2.45125 -0.00738898 3.29833 0.00012904L28.6737 0.010996C29.5284 0.01137 30.3503 0.339958 30.9694 0.928816C31.5885 1.51767 31.9574 2.32176 32 3.17482Z" fill="#EC1C2B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,8 @@
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.39199 13.22H5.50801C3.43601 13.22 1.75 11.538 1.75 9.47002L1.75 5.5C1.75 3.432 3.43601 1.75 5.50801 1.75L19.492 1.75C21.564 1.75 23.25 3.432 23.25 5.5L23.25 9.62998C23.25 10.044 22.914 10.38 22.5 10.38C22.086 10.38 21.75 10.044 21.75 9.62998L21.75 5.5C21.75 4.259 20.737 3.25 19.492 3.25L5.50801 3.25C4.26301 3.25 3.25 4.259 3.25 5.5L3.25 9.47002C3.25 10.711 4.26301 11.72 5.50801 11.72H8.39199C8.80599 11.72 9.14199 12.056 9.14199 12.47C9.14199 12.884 8.80599 13.22 8.39199 13.22Z" fill="#161616"/>
<path d="M6.44824 7.5C6.44824 8.052 6.90025 8.5 7.45225 8.5C8.00425 8.5 8.45322 8.052 8.45322 7.5C8.45322 6.948 8.00522 6.5 7.45322 6.5H7.44424C6.89124 6.5 6.44824 6.948 6.44824 7.5Z" fill="#161616"/>
<path d="M12.4522 8.5C11.9002 8.5 11.4482 8.052 11.4482 7.5C11.4482 6.948 11.8912 6.5 12.4442 6.5H12.4532C13.0052 6.5 13.4532 6.948 13.4532 7.5C13.4532 8.052 13.0042 8.5 12.4522 8.5Z" fill="#161616"/>
<path d="M16.4482 7.5C16.4482 8.052 16.9002 8.5 17.4522 8.5C18.0042 8.5 18.4532 8.052 18.4532 7.5C18.4532 6.948 18.0052 6.5 17.4532 6.5H17.4442C16.8912 6.5 16.4482 6.948 16.4482 7.5Z" fill="#161616"/>
<path d="M15.1212 19.25H15.1582C15.4212 19.25 15.6662 19.111 15.8022 18.884L15.804 18.881C15.8372 18.8262 16.3112 18.0432 16.9722 17.2C17.8102 16.132 18.5922 15.422 19.1742 15.201C19.5612 15.054 19.7562 14.621 19.6092 14.234C19.4622 13.847 19.0292 13.652 18.6422 13.799C17.2942 14.311 15.9432 16.0009 15.1642 17.1179C14.6062 16.4859 14.0932 16.421 13.9082 16.421C13.4942 16.421 13.1582 16.757 13.1582 17.171C13.1582 17.551 13.4412 17.8649 13.8082 17.9139C13.8692 17.9449 14.1482 18.115 14.4792 18.82C14.5972 19.071 14.8442 19.236 15.1212 19.25Z" fill="#161616"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.71582 16.5C9.71582 20.222 12.7518 23.25 16.4828 23.25C20.2138 23.25 23.2488 20.222 23.2488 16.5C23.2488 12.778 20.2138 9.75 16.4828 9.75C12.7518 9.75 9.71582 12.778 9.71582 16.5ZM11.2158 16.5C11.2158 13.605 13.5788 11.25 16.4828 11.25C19.3868 11.25 21.7488 13.605 21.7488 16.5C21.7488 19.395 19.3868 21.75 16.4828 21.75C13.5788 21.75 11.2158 19.395 11.2158 16.5Z" fill="#161616"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -1344,7 +1344,7 @@ const Map localizedValues = {
"select-appo": {"en": "Kindly select one of the available appointments from below:", "ar": " يرجى اختيار أحد المواعيد المتاحة مما يلي:"},
"covid-alert-header": {"en": "Pay With-in 15 mins to confirm the appointment", "ar": "الرجاء اتمام عملية الدفع خلال 15 دقيقه لتاكيد الموعد"},
"covid-alert-info": {
"en": "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically",
"en": "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically.",
"ar": "سيتم الغاء الموعد عن طريق النظام بشكل الي في حال عدم اتمام عمليه الدفع خلال 15 دقيقة"
},
"covid-alert-mins": {"en": "Pay With-in 15 mins", "ar": "ادفع خلال 15 دقيقة"},
@ -2340,6 +2340,29 @@ const Map localizedValues = {
"enableQuickLogin": {"en": "Enable Quick Login", "ar":"تمكين تسجيل الدخول السريع"},
"enableMsg": {"en": "Enabling the quick login will verify through your existing device Face ID / Biometric", "ar":"'تمكين تسجيل الدخول السريع سيسمح بالتحقق من خلال Face ID / Biometric الخاص بجهازك الحالي'"},
"notNow": {"en": "Not Now", "ar":"ليس الآن"},
"fullName": {"en": "Full Name", "ar":"الاسم الكامل"},
"personalDetailsVerificaion": {"en": "Personal Details Verification", "ar":"التحقق من التفاصيل الشخصية"},
"married": {"en": "Married", "ar":"متزوج"},
"uae": {"en": "United Arab Emirates", "ar":"الإمارات العربية المتحدة"},
"enterFullName": {"en": "Please enter your Full Name", "ar":"الرجاء إدخال اسمك الكامل"},
"chooseMaritalStatus": {"en": "Please choose Marital Status", "ar":"الرجاء اختيار الحالة الاجتماعية"},
"chooseYourCountry": {"en": "Please choose Country", "ar":"الرجاء اختيار بلدك"},
"enterEmailAddress": {"en": "Please enter your email address.", "ar":"الرجاء إدخال عنوان بريدك الإلكتروني."},
"sendOTPSMS": {"en": "Send me OTP on SMS", "ar":"أرسل لي OTP عبر الرسائل القصيرة"},
"sendOTPWHATSAPP": {"en": "Send me OTP on Whatsapp", "ar":"أرسل لي OTP عبر واتساب"},
"validIQama": {"en": "Please enter a valid Iqama number", "ar":"الرجاء إدخال رقم إقامة صالح"},
"oR": {"en": "OR", "ar":"أو"},
"pleaseEnterNationalId": {"en": "Please enter your national id", "ar":"الرجاء إدخال رقم الهوية الوطنية الخاص بك"},
"pleaseSelectCountry": {"en": "Please select your country", "ar":"الرجاء اختيار بلدك"},
"pleaseSelectDOB": {"en": "Please enter your date of birth", "ar":"الرجاء إدخال تاريخ ميلادك"},
"pleaseAcceptTermsConditions": {"en": "Please check agree to the term and conditions", "ar":"الرجاء الموافقة على الشروط والأحكام"},
"lastLoginBy": {"en": "Last Login by", "ar":"آخر تسجيل دخول بواسطة"},
"enterPhoneNumber": {"en": "Enter Phone Number", "ar":"أدخل رقم الهاتف"},
"enterEmailDesc": {"en": "Enter your email address to complete the process of creating a medical file", "ar":"أدخل عنوان بريدك الإلكتروني لإكمال عملية إنشاء ملف طبي"},
"enterPhoneDesc": {"en": "Enter your phone number to receive OTP verification code", "ar":"أدخل رقم هاتفك لتلقي رمز التحقق OTP"},
"otpVerification": {"en": "OTP Verification", "ar":"التحقق من OTP"},
"submiT": {"en": "Submit", "ar":"إرسال"},

@ -113,7 +113,7 @@ class Patientobject {
String? dateofBirthN;
String? emailAddress;
int? sourceType;
int? preferredLanguage;
dynamic? preferredLanguage;
String? marital;
Patientobject({

@ -0,0 +1,29 @@
import 'dart:convert';
class NationalityCountries {
String? id;
String? name;
String? nameN;
NationalityCountries({
this.id,
this.name,
this.nameN,
});
factory NationalityCountries.fromRawJson(String str) => NationalityCountries.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory NationalityCountries.fromJson(Map<String, dynamic> json) => NationalityCountries(
id: json["ID"],
name: json["Name"],
nameN: json["NameN"],
);
Map<String, dynamic> toJson() => {
"ID": id,
"Name": name,
"NameN": nameN,
};
}

@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.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/uitl/font_utils.dart';
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
class GenericBottomSheet extends StatefulWidget {
@ -11,8 +13,13 @@ class GenericBottomSheet extends StatefulWidget {
final List<Widget> buttons;
TextEditingController? textController;
final bool isForEmail;
Function(Country)? onCountryChange;
final bool isEnableCountryDropdown;
final bool isFromSavedLogin;
GenericBottomSheet({Key? key, this.countryCode = "", this.initialPhoneNumber = "", required this.buttons, this.textController, this.isForEmail = false}) : super(key: key);
GenericBottomSheet(
{Key? key, this.countryCode = "", this.initialPhoneNumber = "", required this.buttons, this.textController, this.isForEmail = false, this.onCountryChange, this.isEnableCountryDropdown = false, this.isFromSavedLogin = false})
: super(key: key);
@override
_GenericBottomSheetState createState() => _GenericBottomSheetState();
@ -34,66 +41,77 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
onTap: () {
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside
},
child: Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Color(0xFFF8F8FA),
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Title
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Builder(builder: (context) {
final isRtl = Directionality.of(context) == TextDirection.rtl;
return Directionality(
textDirection: Directionality.of(context),
child: Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Color(0xFFF8F8FA),
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
AppText(widget.isForEmail ? "Enter Email Address" : "Enter Phone Number",
fontSize: 28, letterSpacing: -2, fontFamily: context.fontFamily, color: Color(0xFF2E3039), fontWeight: FontWeight.w600),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: SvgPicture.asset("assets/images/svg/cross-circle.svg", width: 24, height: 24)),
// Title
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(widget.isForEmail ? TranslationBase.of(context).enterEmailAddress : TranslationBase.of(context).enterPhoneNumber,
fontSize: 28, letterSpacing: -2, color: Color(0xFF2E3039), fontWeight: FontWeight.w600),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: SvgPicture.asset("assets/images/svg/cross-circle.svg", width: 24, height: 24)),
],
),
const SizedBox(height: 10),
// Subtitle
AppText(widget.isForEmail ? TranslationBase.of(context).enterEmailDesc : TranslationBase.of(context).enterPhoneDesc,
fontSize: 16, color: Color(0xFF2E3039), fontWeight: FontWeight.w500),
const SizedBox(height: 10),
widget.textController != null
? Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
newInputWidget(
widget.isForEmail ? TranslationBase.of(context).email : TranslationBase.of(context).phoneNumber,
widget.isForEmail ? "demo@gmail.com" : "5xxxxxxxx",
widget.textController!,
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
keyboardType: widget.isForEmail ? TextInputType.emailAddress : TextInputType.number,
onChange: (value) {
widget.textController!.text = value!;
},
isEnable: true,
isReadOnly: widget.isFromSavedLogin,
prefix: widget.isForEmail ? null : widget.countryCode,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
countryList: Country.values,
isCountryDropDown: widget.isEnableCountryDropdown,
// selectedCountry: widget,
onCountryChange: (Country country) {
widget.onCountryChange!(country);
},
leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg",
),
],
)
: SizedBox(),
SizedBox(height: 24),
...widget.buttons,
],
),
const SizedBox(height: 10),
// Subtitle
AppText(widget.isForEmail ? "Enter your email address to complete the process of creating a medical file" : "Enter your phone number to receive OTP verification code",
fontSize: 16, fontFamily: context.fontFamily, color: Color(0xFF2E3039), fontWeight: FontWeight.w500),
const SizedBox(height: 10),
widget.textController != null
? Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(
widget.isForEmail ? TranslationBase.of(context).email : TranslationBase.of(context).phoneNumber,
widget.isForEmail ? "demo@gmail.com" : "5xxxxxxxx",
widget.textController!,
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
keyboardType: widget.isForEmail ? TextInputType.emailAddress : TextInputType.number,
onChange: (value) {
widget.textController!.text = value!;
},
isEnable: true,
prefix: widget.isForEmail ? null : widget.countryCode,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg",
),
),
],
)
: SizedBox(),
SizedBox(height: 24),
...widget.buttons,
],
),
),
),
);
}),
),
);
}
@ -123,7 +141,7 @@ class CustomButton extends StatelessWidget {
this.textColor = Colors.white,
this.borderRadius = 12,
this.borderWidth = 1,
this.padding = const EdgeInsets.fromLTRB(8, 16, 8, 16),
this.padding = const EdgeInsets.fromLTRB(8, 10, 8, 10),
this.fontSize = 16,
this.fontFamily,
this.fontWeight = FontWeight.w500,
@ -136,7 +154,6 @@ class CustomButton extends StatelessWidget {
return GestureDetector(
onTap: isDisabled ? null : onPressed,
child: Container(
padding: padding,
height: 56,
decoration: BoxDecoration(
color: isDisabled ? backgroundColor.withOpacity(0.5) : backgroundColor,
@ -146,29 +163,31 @@ class CustomButton extends StatelessWidget {
width: borderWidth,
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != null)
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
icon!,
width: 24,
height: 24,
child: Padding(
padding: padding,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != null)
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
icon!,
width: 24,
height: 24,
),
),
Text(
text,
style: context.dynamicTextStyle(
fontSize: fontSize,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
fontWeight: fontWeight,
),
),
Text(
text,
style: TextStyle(
fontSize: fontSize,
fontFamily: fontFamily ?? context.fontFamily,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
fontWeight: fontWeight,
),
),
],
],
),
),
),
);

@ -746,11 +746,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
context: context,
backgroundColor: Colors.transparent,
isScrollControlled: true,
builder: (context) => QuickLoginBottomSheet(
isDone:isDone,
onPressed: (){
loginWithFingerPrintFace(3, 1, user, deviceToken);
},),
builder: (context) => Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: QuickLoginBottomSheet(
isDone:isDone,
onPressed: (){
loginWithFingerPrintFace(3, 1, user, deviceToken);
},),
),
);
}
loginWithFingerPrintFace(type, int isActive, AuthenticatedUser user, String deviceToken ) async {

@ -21,6 +21,7 @@ import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
@ -54,7 +55,8 @@ class _RegisterNew extends State<RegisterNew> {
final int loginType = LoginType.loginType;
late String mobileNo;
String countryCode = '966';
// String countryCode = '966';
var isHijri;
final util = Utils();
@ -85,9 +87,6 @@ class _RegisterNew extends State<RegisterNew> {
@override
Widget build(BuildContext context) {
return AppScaffold(
// extendBody: true,
// extendBodyBehindAppBar: true,
appBarTitle: TranslationBase.of(context).register,
isShowDecPage: false,
isShowAppBar: true,
@ -105,7 +104,7 @@ class _RegisterNew extends State<RegisterNew> {
},
body: GestureDetector(
onTap: () {
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside
FocusScope.of(context).unfocus();
},
child: ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(overscroll: false, physics: const ClampingScrollPhysics()),
@ -115,7 +114,7 @@ class _RegisterNew extends State<RegisterNew> {
return true;
},
child: SingleChildScrollView(
physics: ClampingScrollPhysics(), // Remove NeverScrollableScrollPhysics()
physics: ClampingScrollPhysics(),
padding: EdgeInsets.only(
left: 24,
right: 24,
@ -135,7 +134,13 @@ class _RegisterNew extends State<RegisterNew> {
Text(
TranslationBase.of(context).prepareToElevate,
textScaler: TextScaler.linear(MediaQuery.textScalerOf(context).scale(1)),
style: TextStyle(fontSize: 28, fontFamily: context.fontFamily, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 40 / 28),
style: context.dynamicTextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Color(0xff2B353E),
letterSpacing: -0.4,
height: 40 / 28,
),
),
SizedBox(height: 24),
Directionality(
@ -147,7 +152,7 @@ class _RegisterNew extends State<RegisterNew> {
children: [
newInputWidget(
TranslationBase.of(context).country,
"Kingdom Of Saudi Arabia",
TranslationBase.of(context).ksa,
nationalIDorFile,
isEnable: true,
prefix: null,
@ -157,6 +162,7 @@ class _RegisterNew extends State<RegisterNew> {
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
print(val);
setState(() {
selectedCountry = CountryExtension.fromDisplayName(val);
});
@ -200,16 +206,13 @@ class _RegisterNew extends State<RegisterNew> {
lang: context.selectedLanguage,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/birthday-cake.svg", onChange: (value) {
print("=========== " + value!);
selectedDOB = DateTime.parse(value);
selectedDOB = DateTime.parse(value!);
setState(() {});
}, onCalendarTypeChanged: (bool value) {
if (value) {
print("gregorian");
isHijri = 0; // Hijri
isHijri = 0;
} else {
print("hijri");
isHijri = 1; // Gregorian
isHijri = 1;
}
}).withVerticalPadding(8),
],
@ -256,23 +259,27 @@ class _RegisterNew extends State<RegisterNew> {
onPressed: () {
// bool isValid = Utils.validateIqama(nationalIDorFile.text);
if (nationalIDorFile == null) {
Utils.showErrorToast("Please enter your national id.");
Utils.showErrorToast(TranslationBase.of(context).pleaseEnterNationalId);
return;
}
if (selectedCountry == null) {
Utils.showErrorToast("Please select your country.");
Utils.showErrorToast(TranslationBase.of(context).pleaseSelectCountry);
return;
}
if (selectedDOB == null) {
Utils.showErrorToast("Please enter your date of birth.");
Utils.showErrorToast(TranslationBase.of(context).pleaseSelectDOB);
return;
}
if (!isTermsAccepted) {
Utils.showErrorToast("Please accept the terms and conditions.");
Utils.showErrorToast(TranslationBase.of(context).pleaseAcceptTermsConditions);
return;
}
if (phoneController != null) {
phoneController.clear();
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
@ -289,14 +296,14 @@ class _RegisterNew extends State<RegisterNew> {
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on SMS",
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
registerUser(val);
//if (val != null) checkUserAuthentication(val);
},
backgroundColor: Colors.red,
borderColor: Colors.red,
backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor,
textColor: Colors.white,
icon: "assets/images/svg/message.svg",
),
@ -308,7 +315,7 @@ class _RegisterNew extends State<RegisterNew> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppText(
"OR",
TranslationBase.of(context).oR,
fontSize: 16,
fontFamily: context.fontFamily,
color: Color(0xFF2E3039),
@ -320,7 +327,7 @@ class _RegisterNew extends State<RegisterNew> {
Padding(
padding: const EdgeInsets.only(bottom: 10, top: 10),
child: CustomButton(
text: "Send me OTP on WhatsApp",
text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController);
registerUser(val);
@ -345,28 +352,21 @@ class _RegisterNew extends State<RegisterNew> {
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
style: context.dynamicTextStyle(
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: TranslationBase.of(context).alreadyHaveAccount, style: context.dynamicTextStyle()),
TextSpan(text: " "),
TextSpan(
text: TranslationBase.of(context).loginNow,
style: TextStyle(
color: Colors.red,
style: context.dynamicTextStyle(
color: CustomColors.bgRedColor,
fontSize: 16,
height: 26 / 16,
fontFamily: context.fontFamily,
fontWeight: FontWeight.w500,
),
recognizer: TapGestureRecognizer()
@ -466,8 +466,8 @@ class _RegisterNew extends State<RegisterNew> {
var request = CheckPatientForRegistration();
request.patientMobileNumber = int.parse(mobileNo);
request.zipCode = countryCode;
request.patientOutSA = countryCode == '966' ? 0 : 1;
request.zipCode = selectedCountry.countryCode;
request.patientOutSA = selectedCountry.countryCode == '966' ? 0 : 1;
request.patientIdentificationID = int.parse(nationalIDorFile.text);
request.patientID = 0;
request.isRegister = true;
@ -528,9 +528,7 @@ class _RegisterNew extends State<RegisterNew> {
if (request.patientOutSA == 0) {
this.chekUserData(response['LogInTokenID'], type); // ظ ;
} else {
//Dubai registration page should be navigate from here..
// Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true, isDubai: true)));
sendActivationCode(type, response['LogInTokenID'], null);
}
}
} else {
@ -549,31 +547,25 @@ class _RegisterNew extends State<RegisterNew> {
}
chekUserData(loginToken, int type) {
// let m = hijri(this.dateOfBirth).locale('en');
// // const dateHijri = m.format('iDD/iMM/iYYYY');
// const request = {
// PatientIdentificationID: this.id.toString(),
// // TokenID: token,
// DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'),
// IsHijri: Number(this.dateOption)
// }
GifLoaderDialogUtils.showMyDialog(context);
var request = CheckUserStatusRequest();
request.patientIdentificationID = nationalIDorFile.text;
request.dOB = isHijri == 1 ? selectedDOB!.toString() : dateFormat.format(selectedDOB!);
request.isHijri = isHijri;
request.patientOutSA = countryCode == '966' ? 0 : 1;
request.patientOutSA = selectedCountry.countryCode == '966' ? 0 : 1;
this.authService.checkUserStatus(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
if (result is Map) {
RegisterInfoResponse? resultSet;
CheckUserStatusResponse res = CheckUserStatusResponse.fromJson(result as Map<String, dynamic>);
nHICData = res;
sharedPref.setObject(NHIC_DATA, res.toJson());
resultSet = RegisterInfoResponse.fromJson(res.toJson());
// widget.changePageViewIndex!(1),
// Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true))),
RegisterInfoResponse resultSet = RegisterInfoResponse.fromJson(res.toJson());
sendActivationCode(type, loginToken, resultSet);
} else {
AppToast.showErrorToast(message: result != null ? result : TranslationBase.of(context).somethingWentWrong);
@ -581,7 +573,7 @@ class _RegisterNew extends State<RegisterNew> {
});
}
sendActivationCode(type, loginTokenID, RegisterInfoResponse nHICData) async {
sendActivationCode(type, loginTokenID, RegisterInfoResponse? nHICData) async {
LoginTokenID = loginTokenID;
var request = authService.getCommonRequest(
registerd_data: null,
@ -593,21 +585,19 @@ class _RegisterNew extends State<RegisterNew> {
selectedOption: type,
user: SelectDeviceIMEIRES());
request.isRegister = true;
// request.searchType =1 ;
request.dob = isHijri == 1 ? selectedDOB!.toString() : dateFormat.format(selectedDOB!);
request.sMSSignature = await SMSOTP.getSignature();
// selectedOption = type;
GifLoaderDialogUtils.showMyDialog(context);
// if (healthId != null || isDubai) {
// if (!isDubai) {
// // request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
// request.dob = nHICData.isHijri == true ? nHICData.dateOfBirth : dateFormat.format(dateFormat.parse(nHICData.dateOfBirth!));
// }
request.healthId = nHICData.healthId;
if (selectedCountry.countryCode == "966") {
request.healthId = nHICData!.healthId;
request.nationalID = nHICData.idNumber;
request.patientIdentificationID = nHICData.idNumber;
} else {
request.nationalID = nationalIDorFile.text;
request.patientIdentificationID = nationalIDorFile.text;
}
request.isHijri = isHijri ?? 0;
request.nationalID = nHICData.idNumber;
request.patientIdentificationID = nHICData.idNumber;
request.oTPSendType = type;
await this.authService.sendActivationCodeRegister(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
@ -640,10 +630,12 @@ class _RegisterNew extends State<RegisterNew> {
// request['DOB'] = dob;
// }
request.dob = isHijri == 1 ? selectedDOB!.toString() : dateFormat.format(selectedDOB!);
request.healthId = nHICData!.healthId!;
if (selectedCountry.countryCode == "966") {
request.healthId = nHICData!.healthId!;
}
request.isHijri = isHijri ?? 0;
request.nationalID = nHICData!.idNumber;
request.patientIdentificationID = nHICData!.idNumber;
request.nationalID = selectedCountry.countryCode == "966" ? nHICData!.idNumber : nationalIDorFile.text;
request.patientIdentificationID = selectedCountry.countryCode == "966" ? nHICData!.idNumber : nationalIDorFile.text;
request.isRegister = true;
authService
@ -656,7 +648,7 @@ class _RegisterNew extends State<RegisterNew> {
//next registration page navigate from here.
Navigator.of(context).push(
FadePage(page: RegisterNewStep2(nHICData!, request)),
FadePage(page: RegisterNewStep2(nHICData, request)),
)
// // if(widget.isDubai ==false){

@ -6,18 +6,21 @@ import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
import 'package:hmg_patient_app/extensions/string_extensions.dart';
import 'package:hmg_patient_app/locator.dart';
import 'package:hmg_patient_app/models/Appointments/toDoCountProviderModel.dart';
import 'package:hmg_patient_app/models/Authentication/check_activation_code_response.dart';
import 'package:hmg_patient_app/models/Authentication/check_activation_code_response.dart' hide List;
import 'package:hmg_patient_app/models/Authentication/check_user_status_reponse.dart';
import 'package:hmg_patient_app/models/Authentication/register_info_response.dart';
import 'package:hmg_patient_app/models/Authentication/send_activation_request.dart';
import 'package:hmg_patient_app/models/Nationality_countires_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/Blood/blood_donation.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';
import 'package:hmg_patient_app/pages/login/register_new.dart';
import 'package:hmg_patient_app/pages/login/welcome.dart';
import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
import 'package:hmg_patient_app/services/clinic_services/get_clinic_service.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
@ -28,17 +31,14 @@ import 'package:hmg_patient_app/uitl/utils.dart';
import 'package:hmg_patient_app/uitl/utils_new.dart';
import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart';
import '../../widgets/dialogs/confirm_dialog.dart';
import 'package:hijri/hijri_calendar.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class RegisterNewStep2 extends StatefulWidget {
CheckUserStatusResponse nHICData;
CheckUserStatusResponse? nHICData;
SendActivationRequest payload;
RegisterNewStep2(this.nHICData, this.payload, {Key? key}) : super(key: key);
@ -49,77 +49,133 @@ class RegisterNewStep2 extends StatefulWidget {
class _RegisterNew extends State<RegisterNewStep2> {
final emailAddress = TextEditingController();
final int loginType = LoginType.loginType;
late String mobileNo;
String countryCode = '966';
final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
late ProjectViewModel projectViewModel;
bool isFromDubai = false;
List<NationalityCountries> countriesList = [];
// TextEditingController nationality = TextEditingController();
String? name, nationalId;
NationalityCountries? selectedCountry;
GenderType? selectedGenderType;
MaritalStatusType? selectedMaritalStatusType;
@override
void initState() {
super.initState();
isFromDubai = widget.payload.zipCode!.contains("971") || widget.payload.zipCode!.contains("+971");
if (isFromDubai) {
getCountries();
}
// isFromDubai = widget.payload.zipCode!.contains("971") || widget.payload.zipCode!.contains("+971");
}
getCountries() {
ClinicListService service = ClinicListService();
service.getCountries().then((res) {
if (res['MessageStatus'] == 1) {
print(res['ListNationality']);
countriesList = (res['ListNationality'] as List).map((e) => NationalityCountries.fromJson(e)).toList();
setState(() {});
}
}).catchError((err) {
print(err);
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: "Personal Details Verification",
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
showDropDown: false,
isShowLanguageChanger: false,
showHomeAppBarIcon: false,
resizeToAvoidBottomInset: true,
appBarIcons: [],
dropDownIndexChange: (value) {
Utils.changeAppLanguage(context: context);
},
body: SafeArea(
child: SingleChildScrollView(
reverse: false,
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Directionality(
textDirection: Directionality.of(context),
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).name, (widget.nHICData.firstNameEn!.toUpperCase() + " " + widget.nHICData.lastNameEn!.toUpperCase()), null,
appBarTitle: TranslationBase.of(context).personalDetailsVerificaion,
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
showDropDown: false,
isShowLanguageChanger: false,
showHomeAppBarIcon: false,
resizeToAvoidBottomInset: true,
appBarIcons: [],
dropDownIndexChange: (value) {
Utils.changeAppLanguage(context: context);
},
body: SingleChildScrollView(
reverse: false,
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Directionality(
textDirection: Directionality.of(context),
child: Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)),
padding: EdgeInsets.only(left: 16, right: 16),
child: Column(
children: [
inputWidget(isFromDubai ? TranslationBase.of(context).fullName : TranslationBase.of(context).name,
isFromDubai ? name ?? "" : (widget.nHICData!.firstNameEn!.toUpperCase() + " " + widget.nHICData!.lastNameEn!.toUpperCase()), null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
keyboardType: TextInputType.text,
isAllowLeadingIcon: true,
isReadOnly: isFromDubai ? false : true,
leadingIcon: "assets/images/svg/user-circle.svg", onChange: (value) {
name = value;
setState(() {});
}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).nationalIdNumber, isFromDubai ? widget.payload.nationalID! : (widget.nHICData!.idNumber ?? ""), null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/student-card.svg",
onChange: (value) {}),
Divider(height: 1),
isFromDubai
? inputWidget(
TranslationBase.of(context).gender,
TranslationBase.of(context).male,
null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
hasSelection: true,
dropdownItems: GenderType.values.map((e) => context.selectedLanguage == "ar" ? e.typeAr : e.type).toList(),
selectedValue: context.selectedLanguage == "ar" ? selectedGenderType!.typeAr : selectedGenderType?.type,
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
print(val);
setState(() {
selectedGenderType = GenderTypeExtension.fromType(val);
});
}
},
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/user-circle.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).nationalIdNumber, (widget.nHICData.idNumber ?? ""), null,
isEnable: true,
prefix: null,
hasSelectionCustomIcon: true,
removePadding: true,
isLeadingCountry: false,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/student-card.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).gender, (widget.nHICData.gender ?? ""), null,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: "assets/images/svg/arrow-down.svg",
leadingIcon: 'assets/images/svg/user-full.svg',
).withVerticalPadding(8)
: inputWidget(TranslationBase.of(context).gender, (widget.nHICData!.gender ?? ""), null,
isEnable: true,
prefix: null,
removePadding: true,
@ -127,23 +183,39 @@ class _RegisterNew extends State<RegisterNewStep2> {
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
isReadOnly: isFromDubai ? false : true,
leadingIcon: "assets/images/svg/user-full.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).maritalStatus, (widget.nHICData.maritalStatus ?? ""), null,
Divider(height: 1),
isFromDubai
? inputWidget(
TranslationBase.of(context).maritalStatus,
TranslationBase.of(context).married,
null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
hasSelection: true,
dropdownItems: MaritalStatusType.values.map((e) => context.selectedLanguage == "ar" ? e.typeAr : e.type).toList(),
selectedValue: context.selectedLanguage == "ar" ? selectedMaritalStatusType!.typeAr : selectedMaritalStatusType?.type,
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
setState(() {
selectedMaritalStatusType = MaritalStatusTypeExtension.fromType(val);
});
}
},
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/smart-phone.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).nationality, (widget.nHICData.nationality ?? ""), null,
hasSelectionCustomIcon: true,
removePadding: true,
isLeadingCountry: false,
isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: "assets/images/svg/arrow-down.svg",
leadingIcon: 'assets/images/svg/smart-phone.svg',
).withVerticalPadding(8)
: inputWidget(TranslationBase.of(context).maritalStatus, (widget.nHICData!.maritalStatus ?? ""), null,
isEnable: true,
prefix: null,
removePadding: true,
@ -152,108 +224,168 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/globe.svg",
leadingIcon: "assets/images/svg/smart-phone.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).mobileNumber, (widget.payload.mobileNo ?? ""), null,
Divider(height: 1),
isFromDubai
? inputWidget(
TranslationBase.of(context).country,
TranslationBase.of(context).uae,
null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
hasSelection: true,
dropdownItems: countriesList.map((e) => context.selectedLanguage == "ar" ? e.nameN ?? "" : e.name ?? "").toList(),
selectedValue: context.selectedLanguage == "ar" ? selectedCountry!.nameN ?? "" : selectedCountry?.name ?? "",
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
setState(() {
selectedCountry = countriesList.firstWhere((element) => element.name == val);
});
}
},
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/call.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).dob, (widget.nHICData.dateOfBirth ?? ""), null,
hasSelectionCustomIcon: true,
removePadding: true,
isLeadingCountry: false,
isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: "assets/images/svg/arrow-down.svg",
leadingIcon: 'assets/images/svg/globe.svg',
).withVerticalPadding(8)
: inputWidget(TranslationBase.of(context).nationality, (widget.nHICData!.nationality ?? ""), null,
isEnable: true,
prefix: null,
hasSelection: false,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
hasSelectionCustomIcon: false,
isReadOnly: true,
selectionType: SelectionType.calendar,
selectedValue: widget.payload.dob != null ? Utils.formatDateToDisplay(widget.payload.dob.toString()) : null,
selectionCustomIcon: "assets/images/svg/calendar.svg",
leadingIcon: "assets/images/svg/birthday-cake.svg",
leadingIcon: "assets/images/svg/globe.svg",
onChange: (value) {}),
],
),
Divider(height: 1),
inputWidget(TranslationBase.of(context).mobileNumber, (widget.payload.mobileNo ?? ""), null,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
isReadOnly: true,
leadingIcon: "assets/images/svg/call.svg",
onChange: (value) {}),
Divider(height: 1),
inputWidget(TranslationBase.of(context).dob, isFromDubai ? widget.payload.dob! : (widget.nHICData!.dateOfBirth ?? ""), null,
isEnable: true,
prefix: null,
hasSelection: false,
removePadding: true,
isBorderAllowed: false,
isAllowLeadingIcon: true,
hasSelectionCustomIcon: false,
isReadOnly: true,
selectionType: SelectionType.calendar,
selectedValue: widget.payload.dob != null ? Utils.formatDateToDisplay(widget.payload.dob.toString()) : null,
selectionCustomIcon: "assets/images/svg/calendar.svg",
leadingIcon: "assets/images/svg/birthday-cake.svg",
onChange: (value) {}),
],
),
),
),
SizedBox(
height: 50,
),
Row(
children: [
Expanded(
child: CustomButton(
text: TranslationBase.of(context).cancel,
icon: "assets/images/svg/cancel.svg",
onPressed: () {
Navigator.of(context).pop();
},
fontFamily: context.fontFamily,
backgroundColor: Color(0xFFFEE9EA),
borderColor: Color(0xFFFEE9EA),
textColor: Color(0xFFED1C2B),
),
),
SizedBox(height: 150),
Row(
children: [
Expanded(
child: CustomButton(
text: TranslationBase.of(context).cancel,
icon: "assets/images/svg/cancel.svg",
onPressed: () {
Navigator.of(context).pop();
},
fontFamily: context.fontFamily,
backgroundColor: Color(0xFFFEE9EA),
borderColor: Color(0xFFFEE9EA),
textColor: Color(0xFFED1C2B),
),
),
SizedBox(
width: 16,
),
Expanded(
child: CustomButton(
text: TranslationBase.of(context).confirm,
icon: "assets/images/svg/confirm.svg",
onPressed: () {
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(
textController: emailAddress,
isForEmail: true,
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Submit",
onPressed: () {
if (emailAddress.text.isEmpty) {
Utils.showErrorToast("Please enter your email address.");
return;
} else {
Navigator.of(context).pop();
registerNow();
}
},
backgroundColor: Colors.red,
borderColor: Colors.red,
textColor: Colors.white),
),
],
SizedBox(
width: 16,
),
Expanded(
child: CustomButton(
text: TranslationBase.of(context).confirm,
icon: "assets/images/svg/confirm.svg",
onPressed: () {
if (isFromDubai) {
if (name == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).enterFullName);
return;
}
if (!name!.contains(" ")) if (selectedGenderType == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).enterFullName);
return;
}
if (selectedMaritalStatusType == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).chooseMaritalStatus);
return;
}
if (selectedCountry == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).chooseCountry);
return;
}
}
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(
textController: emailAddress,
isForEmail: true,
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: TranslationBase.of(context).submiT,
onPressed: () {
if (emailAddress.text.isEmpty) {
Utils.showErrorToast(TranslationBase.of(context).enterEmailAddress);
return;
} else {
Navigator.of(context).pop();
registerNow();
}
},
backgroundColor: Color(0xFFED1C2B),
borderColor: Color(0xFFED1C2B),
textColor: Colors.white),
),
),
],
),
);
},
fontFamily: context.fontFamily,
),
)
],
),
SizedBox(height: 14),
),
),
);
},
fontFamily: context.fontFamily,
),
)
],
),
),
));
],
),
),
);
}
Widget showProgress({String? title, String? status, Color? color, bool isNeedBorder = true}) {
@ -314,7 +446,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
registerNow() {
dynamic request;
if (!widget.payload.zipCode!.contains("966"))
if (isFromDubai)
request = getTempUserRequestDubai();
else
request = getTempUserRequest();
@ -363,6 +495,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
}
})
.catchError((err) {
print(err);
// GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = ConfirmDialog(
context: context,
@ -378,39 +511,39 @@ class _RegisterNew extends State<RegisterNewStep2> {
getTempUserRequest() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
print(dateFormat.parse(widget.nHICData.dateOfBirth!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(widget.nHICData.dateOfBirth!));
print(dateFormat.parse(widget.nHICData!.dateOfBirth!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(widget.nHICData!.dateOfBirth!));
var date = hDate.toString();
return {
"Patientobject": {
"TempValue": true,
"PatientIdentificationType": widget.nHICData.idNumber!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": widget.nHICData.idNumber,
"PatientIdentificationType": widget.nHICData!.idNumber!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": widget.nHICData!.idNumber,
"MobileNumber": int.parse(widget.payload.mobileNo!),
"PatientOutSA": (widget.payload.zipCode == '966' || widget.payload.zipCode == '+966') ? 0 : 1,
"FirstNameN": widget.nHICData.firstNameAr,
"FirstName": widget.nHICData.firstNameEn,
"MiddleNameN": widget.nHICData.secondNameAr,
"MiddleName": widget.nHICData.secondNameEn,
"LastNameN": widget.nHICData.lastNameAr,
"LastName": widget.nHICData.lastNameEn,
"StrDateofBirth": widget.nHICData.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(widget.nHICData.dateOfBirth!.replaceAll('/', '-')),
"Gender": widget.nHICData.gender == 'M' ? 1 : 2,
"NationalityID": widget.nHICData.nationalityCode,
"eHealthIDField": widget.nHICData.healthId,
"FirstNameN": widget.nHICData!.firstNameAr,
"FirstName": widget.nHICData!.firstNameEn,
"MiddleNameN": widget.nHICData!.secondNameAr,
"MiddleName": widget.nHICData!.secondNameEn,
"LastNameN": widget.nHICData!.lastNameAr,
"LastName": widget.nHICData!.lastNameEn,
"StrDateofBirth": widget.nHICData!.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(widget.nHICData!.dateOfBirth!.replaceAll('/', '-')),
"Gender": widget.nHICData!.gender == 'M' ? 1 : 2,
"NationalityID": widget.nHICData!.nationalityCode,
"eHealthIDField": widget.nHICData!.healthId,
"DateofBirthN": date,
"EmailAddress": emailAddress.text,
"SourceType": (widget.payload.zipCode == '966' || widget.payload.zipCode == '+966') ? 1 : 2,
"PreferredLanguage": context.selectedLanguage == "ar" ? 1 : 2,
// "OccupationID": registerInfo.occupationID,
"Marital": widget.nHICData.maritalStatusCode == 'U'
"Marital": widget.nHICData!.maritalStatusCode == 'U'
? '0'
: widget.nHICData.maritalStatusCode == 'M'
: widget.nHICData!.maritalStatusCode == 'M'
? '1'
: '2',
},
"PatientIdentificationID": widget.nHICData.idNumber,
"PatientIdentificationID": widget.nHICData!.idNumber,
"PatientMobileNumber": widget.payload.mobileNo.toString()[0] == '0' ? widget.payload.mobileNo : '0' + widget.payload.mobileNo.toString()
};
}
@ -418,43 +551,45 @@ class _RegisterNew extends State<RegisterNewStep2> {
getTempUserRequestDubai() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
// print(dateFormat.parse(registerd_data.dob!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(widget.nHICData.dateOfBirth!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(widget.payload.dob!));
var date = hDate.toString();
final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
List<String> names = name!.split(" ");
return {
"Patientobject": {
"TempValue": true,
"PatientIdentificationType": widget.nHICData.idNumber!.substring(0, 1) == "1" ? "1" : "2",
"PatientIdentificationNo": widget.nHICData.idNumber,
"PatientIdentificationType": widget.payload.nationalID!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": widget.payload.nationalID,
"MobileNumber": int.parse(widget.payload.mobileNo ?? ""),
"PatientOutSA": (widget.payload.zipCode == '966' || widget.payload.zipCode == '+966') ? 0 : 1,
"FirstNameN": widget.nHICData.firstNameAr ?? "",
"FirstName": widget.nHICData.firstNameEn ?? "",
"MiddleNameN": widget.nHICData.secondNameAr ?? ".",
"MiddleName": widget.nHICData.secondNameEn ?? ".",
"LastNameN": widget.nHICData.lastNameAr ?? "",
"LastName": widget.nHICData.lastNameEn ?? "",
"StrDateofBirth": dateFormat1.format(dateFormat2.parse(widget.nHICData.dateOfBirth!)),
"DateofBirth": DateUtil.convertISODateToJsonDate(widget.nHICData.dateOfBirth!.replaceAll('/', '-')),
"Gender": widget.nHICData.gender == 'M' ? 1 : 2,
"NationalityID": widget.nHICData.nationalityCode,
"FirstNameN": "...",
"FirstName": names[0],
"MiddleNameN": "...",
"MiddleName": "...",
"LastNameN": "...",
"LastName": names.length > 1 ? names[1] : "...",
"StrDateofBirth": dateFormat1.format(dateFormat2.parse(widget.payload.dob!)),
"DateofBirth": DateUtil.convertISODateToJsonDate(widget.payload.dob!.replaceAll('/', '-')),
"Gender": selectedGenderType == GenderType.male ? 1 : 2,
"NationalityID": "UAE",
"eHealthIDField": null,
"DateofBirthN": date,
"EmailAddress": emailAddress.text,
"SourceType": (widget.payload.zipCode == '966' || widget.payload.zipCode == '+966') ? 1 : 2,
"PreferredLanguage": context.selectedLanguage == "ar" ? 1 : 2,
"Marital": widget.nHICData.maritalStatusCode == 'U'
"PreferredLanguage": context.selectedLanguage == "ar" ? "1" : "2",
"Marital": selectedMaritalStatusType == MaritalStatusType.single
? '0'
: widget.nHICData.maritalStatusCode == 'M'
: selectedMaritalStatusType == MaritalStatusType.married
? '1'
: '2',
},
"PatientIdentificationID": widget.nHICData.idNumber,
"PatientIdentificationID": widget.payload.nationalID,
"PatientMobileNumber": widget.payload.mobileNo.toString()[0] == '0' ? widget.payload.mobileNo : '0' + widget.payload.mobileNo.toString(),
"DOB": widget.nHICData.dateOfBirth,
"DOB": widget.payload.dob,
"IsHijri": widget.payload.isHijri
};
}
getName() {}
}

@ -22,20 +22,23 @@ import 'package:hmg_patient_app/pages/login/welcome.dart';
import 'package:hmg_patient_app/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:hmg_patient_app/services/authentication/auth_provider.dart' hide sharedPref;
import 'package:hmg_patient_app/services/clinic_services/get_clinic_service.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/date_uitl.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart' hide sharedPref;
import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
import 'package:hmg_patient_app/widgets/otp/sms-popup.dart';
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
class SavedLogin extends StatefulWidget {
final SelectDeviceIMEIRES savedLoginData;
const SavedLogin(this.savedLoginData, {Key? key}) : super(key: key);
@override
@ -43,155 +46,191 @@ class SavedLogin extends StatefulWidget {
}
class _SavedLogin extends State<SavedLogin> {
TextEditingController get phoneController =>
TextEditingController(
text: widget.savedLoginData.mobile!.startsWith('0')
? widget.savedLoginData.mobile!.substring(1)
: widget.savedLoginData.mobile,
TextEditingController get phoneController => TextEditingController(
text: widget.savedLoginData.mobile!.startsWith('0') ? widget.savedLoginData.mobile!.substring(1) : widget.savedLoginData.mobile,
);
final authService = new AuthProvider();
late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider;
Country selectedCountry = Country.saudiArabia;
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
toDoProvider = Provider.of(context);
return Scaffold(
backgroundColor: const Color(0xFFF8F8FA),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Spacer(flex: 2),
// Welcome back text
const Text(
'Welcome back',
style: TextStyle(
fontSize: 22,
color: Color(0xFF6C757D),
fontWeight: FontWeight.w400,
return AppScaffold(
appBarTitle: TranslationBase.of(context).register,
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: false,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: false,
showDropDown: true,
isShowLanguageChanger: true,
appBarIcons: [],
dropDownList: [],
resizeToAvoidBottomInset: true,
showCenteredLogo: true,
dropDownIndexChange: (value) {
Utils.changeAppLanguage(context: context);
},
// backgroundColor: const Color(0xFFF8F8FA),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Spacer(flex: 2),
// Welcome back text
Text(
TranslationBase.of(context).welcomeBack,
style: context.dynamicTextStyle(
fontSize: 22,
color: Color(0xFF898A8D),
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 16),
// Names
Column(
children: [
Text(
widget.savedLoginData.name!.toLowerCase().capitalizeFirstofEach,
style: context.dynamicTextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
color: Color(0xFF2E3039),
height: 26 / 36,
letterSpacing: -0.4,
),
),
// Text(
// 'Abdul Ghaffar',
// style: TextStyle(
// fontSize: 28,
// fontWeight: FontWeight.bold,
// color: Colors.grey[800],
// ),
// ),
],
),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white),
borderRadius: BorderRadius.circular(24.0),
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
blurRadius: 16,
offset: Offset(0, 0),
spreadRadius: 5,
),
],
),
const SizedBox(height: 16),
// Names
Column(
child: Column(
children: [
// Last login info
Text(
TranslationBase.of(context).lastloginBy + ' ${getType(widget.savedLoginData.logInType!, context)}',
style: const TextStyle(
fontSize: 16,
color: Color(0xFF8F9AA3),
fontWeight: FontWeight.w600,
),
),
Text(
widget.savedLoginData.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.grey[800],
widget.savedLoginData.createdOn != null ? DateUtil.getFormattedDate(DateUtil.convertStringToDate(widget.savedLoginData.createdOn!), "d MMMM, y 'at' HH:mm") : '--',
style: const TextStyle(
fontSize: 16,
color: Color(0xFF2E3039),
fontWeight: FontWeight.w600,
),
),
// Text(
// 'Abdul Ghaffar',
// style: TextStyle(
// fontSize: 28,
// fontWeight: FontWeight.bold,
// color: Colors.grey[800],
// ),
// ),
Container(
margin: EdgeInsets.all(16),
child: SvgPicture.asset(
getTypeIcons(widget.savedLoginData.logInType!, context),
color: Color(0xFFED1C2B),
height: 64,
width: 64,
),
),
// Face ID login button
CustomButton(
text: "${TranslationBase.of(context).loginBy} ${getType(widget.savedLoginData.logInType!, context)}",
onPressed: () {
if (widget.savedLoginData.logInType! == 2 || widget.savedLoginData.logInType! == 3) {
loginWithFingerPrintFace(widget.savedLoginData.logInType!, widget.savedLoginData.iMEI!);
} else {
int? val = widget.savedLoginData.logInType!;
checkUserAuthentication(val);
}
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 12,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
// icon: "assets/images/svg/apple-finder.svg",
),
],
),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white),
borderRadius: BorderRadius.circular(8.0),
),
child: Column(children: [
// Last login info
Text(
'Last Login by ${getType(widget.savedLoginData!.logInType!, context)}',
style: const TextStyle(
fontSize: 14,
color: Color(0xFF6C757D),
),
),
Text(
widget.savedLoginData.createdOn != null ? DateUtil.getFormattedDate(DateUtil.convertStringToDate( widget.savedLoginData!.createdOn!), "d MMMM, y 'at' HH:mm") : '--',
style: const TextStyle(
fontSize: 16,
),
),
Container(
margin: EdgeInsets.all(16),
child: SvgPicture.asset(getTypeIcons(widget.savedLoginData!.logInType!, context), color: Colors.red, height: 54, width: 54,),),
// Face ID login button
CustomButton(
text: "${TranslationBase.of(context).loginBy} ${getType(widget.savedLoginData!.logInType!, context)}",
onPressed: (){
if(widget.savedLoginData!.logInType! == 2 || widget.savedLoginData!.logInType! == 3) {
loginWithFingerPrintFace(widget.savedLoginData!
.logInType!, widget.savedLoginData!.iMEI!);
}else {
int? val = widget.savedLoginData!
.logInType!;
checkUserAuthentication(val);
}
},
backgroundColor:Color(0xffFEE9EA),
borderColor:Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 12,
padding : EdgeInsets.fromLTRB(0, 10, 0, 10),
// icon: "assets/images/svg/apple-finder.svg",
),
],),),
const SizedBox(height: 24),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
'OR',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500
),
),
),
const SizedBox(height: 24),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
TranslationBase.of(context).oR,
style: context.dynamicTextStyle(fontSize: 16, fontWeight: FontWeight.w500),
),
const SizedBox(height: 24),
// OTP login button
CustomButton(
text:TranslationBase.of(context).loginByOTP,
onPressed: (){
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
backgroundColor: Colors.transparent,
builder: (bottomSheetContext) => Padding(
),
const SizedBox(height: 24),
// OTP login button
CustomButton(
text: TranslationBase.of(context).loginByOTP,
onPressed: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
useSafeArea: true,
backgroundColor: Colors.transparent,
builder: (bottomSheetContext) => StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom),
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: "966",
initialPhoneNumber: "",
textController: phoneController!, // Assumed to be a TextEditingController
countryCode: selectedCountry.countryCode,
initialPhoneNumber: phoneController.text,
textController: phoneController,
isEnableCountryDropdown: false,
isFromSavedLogin: true,
onCountryChange: (value) {
selectedCountry = value;
setModalState(() {});
},
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: "Send me OTP on SMS",
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
if (val != null) {
checkUserAuthentication(val);
}
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
if (val != null) checkUserAuthentication(val);
},
backgroundColor: Colors.red,
borderColor: Colors.red,
backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor,
textColor: Colors.white,
icon: "assets/images/svg/message.svg",
),
@ -202,25 +241,25 @@ class _SavedLogin extends State<SavedLogin> {
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppText(
"OR",
fontSize: 16,
fontFamily: 'poppins',
color: Color(0xFF2E3039),
fontWeight: FontWeight.w500,
child: Text(
TranslationBase.of(context).oR,
style: context.dynamicTextStyle(
fontSize: 16,
color: Color(0xFF2E3039),
fontWeight: FontWeight.w500,
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
padding: const EdgeInsets.only(bottom: 10, top: 10),
child: CustomButton(
text: "Send me OTP on WhatsApp",
text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController);
if (val != null) {
checkUserAuthentication(val);
}
if (val != null) checkUserAuthentication(val);
},
backgroundColor: Colors.white,
borderColor: Color(0xFF2E3039),
@ -231,65 +270,59 @@ class _SavedLogin extends State<SavedLogin> {
],
),
),
));},
backgroundColor:Colors.white,
borderColor:Colors.black,
textColor: Colors.black,
padding : EdgeInsets.fromLTRB(0, 14, 0, 14),
// icon: "assets/images/svg/apple-finder.svg",
),
const Spacer(flex: 2),
// OR divider
const SizedBox(height: 24),
// Guest and Switch account
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () { Navigator.of(context).pushReplacement(
);
}),
);
},
backgroundColor: Colors.white,
borderColor: Color(0xFF2E3039),
textColor: Color(0xFF2E3039),
borderWidth: 2,
padding: EdgeInsets.fromLTRB(0, 14, 0, 14),
icon: "assets/images/svg/password-validation.svg",
),
const Spacer(flex: 2),
// OR divider
const SizedBox(height: 24),
// Guest and Switch account
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
),
);},
child: Text(
TranslationBase.of(context).guest,
style: TextStyle(
color: Color(0xFFED1C2B),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
);
},
child: Text(
TranslationBase.of(context).guest,
style: context.dynamicTextStyle(color: CustomColors.bgRedColor, fontSize: 16, fontWeight: FontWeight.w500, height: 16 / 26),
),
const SizedBox(width: 24),
TextButton(
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => WelcomeLogin(),
),
);
},
child: Text(
TranslationBase.of(context).switchAccount,
style: TextStyle(
color: Color(0xFFED1C2B),
fontSize: 16,
fontWeight: FontWeight.w500,
),
const SizedBox(width: 24),
TextButton(
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => WelcomeLogin(),
),
),
);
},
child: Text(
TranslationBase.of(context).switchAccount,
style: context.dynamicTextStyle(color: CustomColors.bgRedColor, fontSize: 16, fontWeight: FontWeight.w500, height: 16 / 26),
),
],
),
const SizedBox(height: 20),
],
),
),
],
),
const SizedBox(height: 20),
],
),
),
),
);
}
@ -306,7 +339,7 @@ class _SavedLogin extends State<SavedLogin> {
//need to move this function on provider to avoid multiple repeat
loginWithFingerPrintFace(type, String deviceToken ) async {
loginWithFingerPrintFace(type, String deviceToken) async {
bool authenticated = false;
final LocalAuthentication auth = LocalAuthentication();
@ -333,10 +366,9 @@ class _SavedLogin extends State<SavedLogin> {
return;
}
if (authenticated) {
int lastLogin = 1;
var availableBiometrics = await auth.getAvailableBiometrics();
var availableBiometrics = await auth.getAvailableBiometrics();
if (availableBiometrics.contains(BiometricType.strong)) {
lastLogin = 3; // Assume Face or secure fingerprint
@ -358,11 +390,10 @@ class _SavedLogin extends State<SavedLogin> {
getMobileInfo(request, lastLogin);
}
}
}
getMobileInfo(request,int lastLogin) async{
GifLoaderDialogUtils.showMyDialog(context);
getMobileInfo(request, int lastLogin) async {
GifLoaderDialogUtils.showMyDialog(context);
this.authService.getLoginInfo(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
if (result['SMSLoginRequired'] == false) {
@ -370,7 +401,7 @@ class _SavedLogin extends State<SavedLogin> {
// this.patientOutSA = result['PatientOutSA'];
// setDefault();
sharedPref.setInt(LAST_LOGIN, lastLogin);
checkActivationCode(null, lastLogin,result['LogInTokenID']);
checkActivationCode(null, lastLogin, result['LogInTokenID']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -378,72 +409,71 @@ class _SavedLogin extends State<SavedLogin> {
});
}
checkActivationCode(String? value, int loginType, String? loginToken) async {
AppGlobal.context = context;
GifLoaderDialogUtils.showMyDialog(context);
var request = authService.getCommonRequest(
type: loginType,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: loginToken ??"",
selectedOption: loginType,
user: widget.savedLoginData,
).toJson();
var request = authService
.getCommonRequest(
type: loginType,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: loginToken ?? "",
selectedOption: loginType,
user: widget.savedLoginData,
)
.toJson();
dynamic res;
authService
.checkActivationCode(request, value)
.then((result) async => {
res = result,
if (result is Map)
{
result = CheckActivationCode.fromJson(result as Map<String, dynamic>),
if (result.errorCode == '699')
{
//699 block run here
GifLoaderDialogUtils.hideDialog(context),
Future.delayed(Duration(seconds: 2), () {
AppToast.showErrorToast(message: result.errorEndUserMessage);
Navigator.pop(context);
})
}
else
{
sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false,
// userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""),
//Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res),
await sharedPref.setObject(MAIN_USER, result.list),
await sharedPref.setObject(USER_PROFILE, result.list),
// loginTokenID = result.logInTokenID,
await sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
await sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result, loginType),
projectViewModel.analytics.loginRegistration.login_successful(),
}
}
// else
// {
// // Navigator.of(context).pop(),
// GifLoaderDialogUtils.hideDialog(context),
// Future.delayed(Duration(seconds: 1), () {
// Navigator.of(context).pop();
// AppToast.showErrorToast(message: result, localContext: context);
// startSMSService(tempType);
// }),
//
// projectViewModel.analytics.loginRegistration.login_fail(error: result),
// projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result)
// }
});
}
authService.checkActivationCode(request, value).then((result) async => {
res = result,
if (result is Map)
{
result = CheckActivationCode.fromJson(result as Map<String, dynamic>),
if (result.errorCode == '699')
{
//699 block run here
GifLoaderDialogUtils.hideDialog(context),
Future.delayed(Duration(seconds: 2), () {
AppToast.showErrorToast(message: result.errorEndUserMessage);
Navigator.pop(context);
})
}
else
{
sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false,
// userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""),
//Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res),
await sharedPref.setObject(MAIN_USER, result.list),
await sharedPref.setObject(USER_PROFILE, result.list),
// loginTokenID = result.logInTokenID,
await sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
await sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result, loginType),
projectViewModel.analytics.loginRegistration.login_successful(),
}
}
// else
// {
// // Navigator.of(context).pop(),
// GifLoaderDialogUtils.hideDialog(context),
// Future.delayed(Duration(seconds: 1), () {
// Navigator.of(context).pop();
// AppToast.showErrorToast(message: result, localContext: context);
// startSMSService(tempType);
// }),
//
// projectViewModel.analytics.loginRegistration.login_fail(error: result),
// projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result)
// }
});
}
checkIfUserAgreedBefore(CheckActivationCode result, int type) {
if (projectViewModel.havePrivilege(109)) {
@ -464,7 +494,7 @@ class _SavedLogin extends State<SavedLogin> {
isArabic: projectViewModel.isArabic,
),
),
(r) => false);
(r) => false);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
@ -503,13 +533,13 @@ class _SavedLogin extends State<SavedLogin> {
Navigator.pushAndRemoveUntil(
context,
FadePage(page: RateAppointmentDoctor()),
(route) => false,
(route) => false,
);
} else {
Navigator.pushAndRemoveUntil(
context,
FadePage(page: LandingPage()),
(route) => false,
(route) => false,
);
}
insertIMEI(type);
@ -531,24 +561,25 @@ class _SavedLogin extends State<SavedLogin> {
});
}
insertIMEI(lastLogin) {
authService.insertDeviceImei(lastLogin).then((value) => {}).catchError((err) {
print(err);
});
}
checkUserAuthentication(type) {
GifLoaderDialogUtils.showMyDialog(context);
var req = this.authService.getCommonRequest(type: type,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: "",
selectedOption: type,
user: widget.savedLoginData,);
var req = this.authService.getCommonRequest(
type: type,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: "",
selectedOption: type,
user: widget.savedLoginData,
);
var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
@ -556,29 +587,31 @@ class _SavedLogin extends State<SavedLogin> {
authService
.checkPatientAuthentication(request)
.then((value) => {
if (value['isSMSSent'])
{
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
// this.loginTokenID = value['LogInTokenID'],
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// Future.delayed(Duration(seconds: 1), () {
this.sendActivationCode(type, value['LogInTokenID'])
// })
}
else
{
if (value['IsAuthenticated']) {this.checkActivationCode(null, type, value['LogInTokenID'])}
else {
AppToast.showErrorToast(message: value['errorMessage']),
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: WelcomeLogin(),
),
(r) => false)
}
}
})
if (value['isSMSSent'])
{
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
// this.loginTokenID = value['LogInTokenID'],
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// Future.delayed(Duration(seconds: 1), () {
this.sendActivationCode(type, value['LogInTokenID'])
// })
}
else
{
if (value['IsAuthenticated'])
{this.checkActivationCode(null, type, value['LogInTokenID'])}
else
{
AppToast.showErrorToast(message: value['errorMessage']),
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: WelcomeLogin(),
),
(r) => false)
}
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
@ -586,29 +619,31 @@ class _SavedLogin extends State<SavedLogin> {
}
sendActivationCode(type, String loginToken) async {
var request = this.authService.getCommonRequest(type: type,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: loginToken,
selectedOption: type,
user: widget.savedLoginData,);
var request = this.authService.getCommonRequest(
type: type,
registerd_data: null,
deviceToken: widget.savedLoginData.iMEI,
mobileNumber: int.parse(widget.savedLoginData.mobile!),
zipCode: widget.savedLoginData.outSA == 1 ? '971' : '966',
patientOutSA: widget.savedLoginData.outSA,
loginTokenID: loginToken,
selectedOption: type,
user: widget.savedLoginData,
);
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
request.dob = "";
request.healthId = "";
request.isHijri = 0;
await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
if (result != null && result['isSMSSent'] == true) {
this.startSMSService(type, loginToken);
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: r.toString());
});
request.dob = "";
request.healthId = "";
request.isHijri = 0;
await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
if (result != null && result['isSMSSent'] == true) {
this.startSMSService(type, loginToken);
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: r.toString());
});
}
var tempType;
@ -619,10 +654,10 @@ class _SavedLogin extends State<SavedLogin> {
context,
type,
phoneController.text,
(value) {
(value) {
this.checkActivationCode(value, type, loginToken);
},
() => {
() => {
Navigator.pop(context),
},
).displayDialog(context);
@ -654,15 +689,15 @@ class _SavedLogin extends State<SavedLogin> {
}
});
}
String getTypeIcons(int type, BuildContext context) {
String path='assets/images/svg/';
String path = 'assets/images/svg/';
final types = {
1: path + 'sms.svg',
1: path + 'sms.svg',
2: path + 'fingerprint.svg',
3:path + 'apple-finder.svg',
4: path + 'whatsapp.svg',
3: path + 'apple-finder.svg',
4: path + 'whatsapp.svg',
};
return types[type] ?? path +'sms.svg';
return types[type] ?? path + 'sms.svg';
}
}
}

@ -125,7 +125,7 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 50),
width: double.infinity,
// color: Colors.white,
child: Column(
@ -174,8 +174,10 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: isPageLoaded
? () {
onPressed:
// isPageLoaded
// ?
() {
// if (isTermsAndConditionsPage) {
if (acceptTerms) {
addUsageAgreement();
@ -189,7 +191,8 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
// addUsageAgreement();
// }
}
: null,
// : null
,
child: Text(TranslationBase.of(context).acceptLbl.toUpperCase(),
style: TextStyle(
fontSize: 18.0,
@ -209,8 +212,10 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: isPageLoaded
? () {
onPressed:
// isPageLoaded
// ?
() {
Navigator.pushAndRemoveUntil(
context,
FadePage(
@ -218,7 +223,8 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
),
(r) => false);
}
: null,
// : null
,
child: Text(TranslationBase.of(context).declineLbl.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),

@ -1,4 +1,5 @@
import 'package:flutter/gestures.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hmg_patient_app/analytics/google-analytics.dart';
import 'package:hmg_patient_app/config/config.dart';
import 'package:hmg_patient_app/config/shared_pref_kay.dart';
@ -21,8 +22,10 @@ import 'package:hmg_patient_app/pages/login/user-login-agreement-page.dart';
import 'package:hmg_patient_app/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
import 'package:hmg_patient_app/services/clinic_services/get_clinic_service.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
@ -45,6 +48,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
bool isLoading = true;
TextEditingController nationIdController = TextEditingController();
TextEditingController phoneController = TextEditingController();
Country selectedCountry = Country.saudiArabia;
//checkUserAuthentication();
bool isDubai = false;
@ -75,9 +79,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
bool onlySMSBox = false;
var userData;
late BuildContext _context;
late bool _loading;
int fingrePrintBefore = 0;
@ -124,7 +125,10 @@ class _WelcomeLogin extends State<WelcomeLogin> {
},
child: SingleChildScrollView(
physics: ClampingScrollPhysics(), // Remove NeverScrollableScrollPhysics()
padding: EdgeInsets.only(left: 24, right: 24, ),
padding: EdgeInsets.only(
left: 24,
right: 24,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@ -144,105 +148,112 @@ class _WelcomeLogin extends State<WelcomeLogin> {
),
Text(
TranslationBase.of(context).welcomeToDrSulaiman,
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 28,
fontFamily: (projectViewModel.currentLanguage == 'ar' ? 'Cairo' : 'Poppins'),
fontWeight: FontWeight.w600,
fontWeight: FontWeight.bold,
color: Color(0xff2B353E),
letterSpacing: -0.4,
height: 40 / 28,
),
),
SizedBox(height: 32),
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(
"National ID. or File No",
"1xxxxxxxx",
nationIdController,
isEnable: true,
removePadding: true,
prefix: null,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
leadingIcon: "assets/images/svg/student-card.svg",
),
newInputWidget(
TranslationBase.of(context).idNo + " / " + TranslationBase.of(context).fileNo,
"1xxxxxxxx",
nationIdController,
isEnable: true,
removePadding: true,
prefix: null,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
leadingIcon: "assets/images/svg/student-card.svg",
),
SizedBox(height: 16),
CustomButton(
text: TranslationBase.of(context).login,
// fontFamily: FontUtils.getFontFamily(context),
// padding: EdgeInsets.all(10),
// padding: ,
icon: "assets/images/svg/login1.svg",
onPressed: () {
bool isValid = Utils.validateIqama(nationIdController.text);
if (isValid) {
// bool isValid = Utils.validateIqama(nationIdController.text);
if (true) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
useSafeArea: true,
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",
builder: (bottomSheetContext) => StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom),
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: selectedCountry.countryCode,
initialPhoneNumber: "",
textController: phoneController,
isEnableCountryDropdown: true,
onCountryChange: (value) {
print(value);
selectedCountry = value;
setModalState(() {});
},
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
if (val != null) checkUserAuthentication(val);
},
backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor,
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,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppText(
TranslationBase.of(context).oR,
fontSize: 16,
color: Color(0xFF2E3039),
fontWeight: FontWeight.w500,
),
),
],
),
Padding(
padding: const EdgeInsets.only(bottom: 10, top: 10),
child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP,
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",
),
],
),
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.", context);
}
// } else {
// Utils.showErrorToast(TranslationBase.of(context).validIQama, context);
// }
},
),
SizedBox(height: 14),
@ -250,27 +261,22 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
style: context.dynamicTextStyle(
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: TranslationBase.of(context).dontHaveAccount, style: context.dynamicTextStyle()),
TextSpan(text: " "),
TextSpan(
text: TranslationBase.of(context).registerNow,
style: TextStyle(
color: Colors.red,
style: context.dynamicTextStyle(
color: CustomColors.bgRedColor,
fontSize: 16,
height: 26 / 16,
fontFamily: context.fontFamily,
fontWeight: FontWeight.w500,
),
recognizer: TapGestureRecognizer()
@ -548,7 +554,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = type == 1 ? type : 2;
request.oTPSendType = type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
request.zipCode = "966";
request.zipCode = selectedCountry.countryCode;
request.logInTokenID = this.loginTokenID ?? "";

@ -413,23 +413,21 @@ class AuthProvider with ChangeNotifier {
RegisterUserRequest requestN = RegisterUserRequest(patientobject: Patientobject.fromJson(request["Patientobject"]));
// var requestN = RegisterUserRequest.fromJson(request);
requestN.patientOutSA = requestN.patientobject!.patientOutSa!;
final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
if (nhic != null) {
// requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
// requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
// requestN.healthId = requestN.patientobject!.eHealthIDField!;
// }
final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
requestN.dob = nhic['IsHijri'] ? requestN.patientobject!.dateofBirth :dateFormat2.format(dateFormat.parse(requestN.patientobject!.strDateofBirth!));
requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
requestN.healthId = requestN.patientobject!.eHealthIdField;
requestN.patientIdentificationID = requestN.patientobject!.patientIdentificationNo;
requestN.patientMobileNumber = requestN.patientobject!.mobileNumber.toString();
requestN.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
}
requestN.dob =requestN.isHijri ==1 ? requestN.patientobject!.dateofBirth :dateFormat2.format(dateFormat.parse(requestN.patientobject!.strDateofBirth!));
requestN.isHijri =requestN.isHijri;
requestN.patientIdentificationID = requestN.patientobject!.patientIdentificationNo;
requestN.patientMobileNumber = requestN.patientobject!.mobileNumber.toString();
requestN.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966';
await sharedPref.remove(USER_PROFILE);
@ -1995,7 +1993,7 @@ class AuthProvider with ChangeNotifier {
request.isRegister = registerd_data.isRegister;
} else {
request.searchType = request.searchType != null ? request.searchType : 2;
request.patientID = user!.patientID != null ? user!.patientID : 0;
request.patientID = user.patientID != null ? user.patientID : 0;
request.nationalID = request.nationalID != null ? request.nationalID : '0';
request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0';
request.isRegister = false;

@ -25,4 +25,14 @@ class CustomColors {
static const Color femaleColor = Color(0xFF359846);
static const Color maleColor = Color(0xFFCC9B14);
// New UI Colors
static const Color bgRedColor = Color(0xFFED1C2B);
static const Color bgRedBorderColor = Color(0xFFED1C2B);
}

@ -1,4 +1,3 @@
import 'package:hmg_patient_app/Constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -12,8 +11,11 @@ final blueAccent = Color(0xFFFF9800);
final blueBackground = Color(0xFFFFFFFF);
defaultTheme({fontName}) {
// Use Poppins as default fallback
final defaultFontFamily = fontName ?? 'Poppins';
return ThemeData(
fontFamily: fontName,
fontFamily: defaultFontFamily,
useMaterial3: false,
//projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.red,
@ -40,10 +42,11 @@ defaultTheme({fontName}) {
// primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)),
iconTheme: IconThemeData(),
textTheme: TextTheme(
// bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6),
// headline1: TextStyle(color: Colors.white, letterSpacing: 0.6),
// headline2: TextStyle(color: Colors.white, letterSpacing: 0.6),
),
// Apply font family to all text styles
).apply(fontFamily: defaultFontFamily),
primaryTextTheme: TextTheme(
// Apply font family to primary text theme as well
).apply(fontFamily: defaultFontFamily),
floatingActionButtonTheme: FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme(

@ -0,0 +1,148 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
/// Font utility class to manage consistent font selection across the app
class FontUtils {
/// Get the appropriate font family based on the current language
static bool getFontFamily(BuildContext context) {
final projectViewModel = Provider.of<ProjectViewModel>(context, listen: false);
return projectViewModel.isArabic ? true : false;
}
/// Get the appropriate font family for a specific language
static String getFontFamilyForLanguage(bool isArabic) {
return isArabic ? 'Cairo' : 'Poppins';
}
}
extension DynamicTextStyleExtension on BuildContext {
TextStyle dynamicTextStyle(
{double? fontSize,
FontWeight? fontWeight,
Color? color,
double? letterSpacing,
double? wordSpacing,
double? height,
List<Shadow>? shadows,
Color? backgroundColor,
TextDecoration? decoration,
Color? decorationColor,
TextDecorationStyle? decorationStyle,
double? decorationThickness,
Locale? locale,
TextBaseline? textBaseline,
FontStyle? fontStyle,
bool isLanguageSwitcher = false}) {
final family = FontUtils.getFontFamily(this);
return isLanguageSwitcher
? (family
? GoogleFonts.poppins(
fontSize: fontSize,
fontWeight: fontWeight,
color: color,
letterSpacing: letterSpacing,
wordSpacing: wordSpacing,
height: height,
shadows: shadows,
backgroundColor: backgroundColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
locale: locale ?? Localizations.localeOf(this),
textBaseline: textBaseline,
fontStyle: fontStyle,
)
: GoogleFonts.cairo(
fontSize: fontSize,
fontWeight: fontWeight,
color: color,
letterSpacing: letterSpacing,
wordSpacing: wordSpacing,
height: height,
shadows: shadows,
backgroundColor: backgroundColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
locale: locale ?? Localizations.localeOf(this),
textBaseline: textBaseline,
fontStyle: fontStyle,
))
: (family
? GoogleFonts.cairo(
fontSize: fontSize,
fontWeight: fontWeight,
color: color,
letterSpacing: letterSpacing,
wordSpacing: wordSpacing,
height: height,
shadows: shadows,
backgroundColor: backgroundColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
locale: locale ?? Localizations.localeOf(this),
textBaseline: textBaseline,
fontStyle: fontStyle,
)
: GoogleFonts.poppins(
fontSize: fontSize,
fontWeight: fontWeight,
color: color,
letterSpacing: letterSpacing,
wordSpacing: wordSpacing,
height: height,
shadows: shadows,
backgroundColor: backgroundColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
locale: locale ?? Localizations.localeOf(this),
textBaseline: textBaseline,
fontStyle: fontStyle,
));
// return family
// ? GoogleFonts.cairo(
// fontSize: fontSize,
// fontWeight: fontWeight,
// color: color,
// letterSpacing: letterSpacing,
// wordSpacing: wordSpacing,
// height: height,
// shadows: shadows,
// backgroundColor: backgroundColor,
// decoration: decoration,
// decorationColor: decorationColor,
// decorationStyle: decorationStyle,
// decorationThickness: decorationThickness,
// locale: locale ?? Localizations.localeOf(this),
// textBaseline: textBaseline,
// fontStyle: fontStyle,
// )
// : GoogleFonts.poppins(
// fontSize: fontSize,
// fontWeight: fontWeight,
// color: color,
// letterSpacing: letterSpacing,
// wordSpacing: wordSpacing,
// height: height,
// shadows: shadows,
// backgroundColor: backgroundColor,
// decoration: decoration,
// decorationColor: decorationColor,
// decorationStyle: decorationStyle,
// decorationThickness: decorationThickness,
// locale: locale ?? Localizations.localeOf(this),
// textBaseline: textBaseline,
// fontStyle: fontStyle,
// );
}
}

@ -3487,6 +3487,28 @@ class TranslationBase {
String get enableQuickLogin => localizedValues["enableQuickLogin"][locale.languageCode];
String get enableMsg => localizedValues["enableMsg"][locale.languageCode];
String get notNow => localizedValues["notNow"][locale.languageCode];
String get fullName => localizedValues["fullName"][locale.languageCode];
String get personalDetailsVerificaion => localizedValues["personalDetailsVerificaion"][locale.languageCode];
String get married => localizedValues["married"][locale.languageCode];
String get uae => localizedValues["uae"][locale.languageCode];
String get enterFullName => localizedValues["enterFullName"][locale.languageCode];
String get chooseMaritalStatus => localizedValues["chooseMaritalStatus"][locale.languageCode];
String get chooseCountry => localizedValues["chooseCountry"][locale.languageCode];
String get enterEmailAddress => localizedValues["enterEmailAddress"][locale.languageCode];
String get sendOTPSMS => localizedValues["sendOTPSMS"][locale.languageCode];
String get sendOTPWHATSAPP => localizedValues["sendOTPWHATSAPP"][locale.languageCode];
String get validIQama => localizedValues["validIQama"][locale.languageCode];
String get oR => localizedValues["oR"][locale.languageCode];
String get pleaseEnterNationalId => localizedValues["pleaseEnterNationalId"][locale.languageCode];
String get pleaseSelectCountry => localizedValues["pleaseSelectCountry"][locale.languageCode];
String get pleaseSelectDOB => localizedValues["pleaseSelectDOB"][locale.languageCode];
String get pleaseAcceptTermsConditions => localizedValues["pleaseAcceptTermsConditions"][locale.languageCode];
String get lastloginBy => localizedValues["lastLoginBy"][locale.languageCode];
String get enterPhoneNumber => localizedValues["enterPhoneNumber"][locale.languageCode];
String get enterEmailDesc => localizedValues["enterEmailDesc"][locale.languageCode];
String get enterPhoneDesc => localizedValues["enterPhoneDesc"][locale.languageCode];
String get otpVerfication => localizedValues["otpVerification"][locale.languageCode];
String get submiT => localizedValues["submiT"][locale.languageCode];
String get readMore => localizedValues["readMore"][locale.languageCode];
String get showLess => localizedValues["showLess"][locale.languageCode];

@ -72,6 +72,11 @@ enum Country { saudiArabia, unitedArabEmirates }
enum SelectionType { dropdown, calendar }
enum GenderType { male, female }
enum MaritalStatusType { single, married, divorced, widowed }
class Utils {
static int? onOtpBtnPressed(OTPType type, TextEditingController controller) {
if (controller.text.isEmpty) {
@ -1226,8 +1231,10 @@ extension CountryExtension on Country {
static Country fromDisplayName(String name) {
switch (name) {
case "Kingdom Of Saudi Arabia":
case "المملكة العربية السعودية":
return Country.saudiArabia;
case "United Arab Emirates":
case "الإمارات العربية المتحدة":
return Country.unitedArabEmirates;
default:
throw Exception("Invalid country name");
@ -1252,6 +1259,110 @@ extension SelectedLanguageExtension on BuildContext {
double getLottieScaledHeight(double value) => MediaQuery.of(this).size.height * (value / MediaQuery.of(this).size.height);
}
extension GenderTypeExtension on GenderType {
String get value => this == GenderType.male ? "M" : "F";
String get type => this == GenderType.male ? "Male" : "Female";
String get typeAr => this == GenderType.male ? "ذكر" : "أنثى";
static GenderType? fromValue(String? value) {
switch (value) {
case "M":
return GenderType.male;
case "F":
return GenderType.female;
default:
return null;
}
}
static GenderType? fromType(String? type) {
switch (type) {
case "Male":
return GenderType.male;
case "Female":
return GenderType.female;
default:
return null;
}
}
}
extension MaritalStatusTypeExtension on MaritalStatusType {
String get value {
switch (this) {
case MaritalStatusType.single:
return "U";
case MaritalStatusType.married:
return "M";
case MaritalStatusType.divorced:
return "D";
case MaritalStatusType.widowed:
return "W";
}
}
String get type {
switch (this) {
case MaritalStatusType.single:
return "Single";
case MaritalStatusType.married:
return "Married";
case MaritalStatusType.divorced:
return "Divorced";
case MaritalStatusType.widowed:
return "Widowed";
}
}
String get typeAr {
switch (this) {
case MaritalStatusType.single:
return "أعزب";
case MaritalStatusType.married:
return "متزوج";
case MaritalStatusType.divorced:
return "مطلق";
case MaritalStatusType.widowed:
return "أرمل";
}
}
static MaritalStatusType? fromValue(String? value) {
switch (value) {
case "U":
return MaritalStatusType.single;
case "M":
return MaritalStatusType.married;
case "D":
return MaritalStatusType.divorced;
case "W":
return MaritalStatusType.widowed;
default:
return null;
}
}
static MaritalStatusType? fromType(String? type) {
switch (type) {
case "Single":
return MaritalStatusType.single;
case "Married":
return MaritalStatusType.married;
case "Divorced":
return MaritalStatusType.divorced;
case "Widowed":
return MaritalStatusType.widowed;
default:
return null;
}
}
}
/*
userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () {

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
class LanguageSelector extends StatefulWidget {
final String currentLanguage;
@ -50,13 +51,13 @@ class _LanguageSelectorState extends State<LanguageSelector> {
const SizedBox(width: 6),
Text(
currentLangData['name']?.toUpperCase() ?? 'EN',
style: TextStyle(
style: context.dynamicTextStyle(
fontWeight: FontWeight.w500,
// fontFamily: 'GESSTwo',
fontFamily: (widget.currentLanguage == 'ar' ? 'Cairo' : 'Poppins'),
fontSize: 14,
color: const Color(0xFFED1C2B),
letterSpacing: 0.1),
letterSpacing: 0.1,
isLanguageSwitcher: true,
),
),
],
),

@ -1,6 +1,7 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart' as badge_import;
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app/config/config.dart';
import 'package:hmg_patient_app/config/shared_pref_kay.dart';
import 'package:hmg_patient_app/core/model/ImagesInfo.dart';
@ -87,58 +88,60 @@ class AppScaffold extends StatefulWidget {
final Widget? customAppBar;
final bool isShowLanguageChanger;
final bool resizeToAvoidBottomInset;
final bool showCenteredLogo;
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick;
return this;
}
AppScaffold(
{required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.showNewAppBar = false,
this.showNewAppBarTitle = false,
this.isMainPharmacyPages = false,
this.extendBody = false,
this.hasAppBarParam,
this.bottomSheet,
this.bottomNavigationBar,
this.baseViewModel,
this.floatingActionButton,
this.isPharmacy = false,
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showDropDown = false,
this.showOfferPackagesCart = false,
this.title,
this.description,
this.isShowDecPage = true,
this.isBottomBar = false,
this.backgroundColor,
this.preferredSize = 0.0,
this.appBarIcons,
this.infoList,
this.isHelp = false,
this.icon,
this.showHomeAppBarIcon = true,
this.imagesInfo,
this.dropDownList,
this.dropdownIndexValue,
this.dropDownIndexChange,
this.onTap,
appBar,
this.customAppBar,
this.isLocalLoader = false,
this.isshowBackButton = true,
this.backButtonTab,
this.changeCurrentTab,
this.currentTab,
this.isShowPharmacyAppbar = false,
this.isShowLanguageChanger = false,
this.resizeToAvoidBottomInset = false
});
AppScaffold({
required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.showNewAppBar = false,
this.showNewAppBarTitle = false,
this.isMainPharmacyPages = false,
this.extendBody = false,
this.hasAppBarParam,
this.bottomSheet,
this.bottomNavigationBar,
this.baseViewModel,
this.floatingActionButton,
this.isPharmacy = false,
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showDropDown = false,
this.showOfferPackagesCart = false,
this.title,
this.description,
this.isShowDecPage = true,
this.isBottomBar = false,
this.backgroundColor,
this.preferredSize = 0.0,
this.appBarIcons,
this.infoList,
this.isHelp = false,
this.icon,
this.showHomeAppBarIcon = true,
this.imagesInfo,
this.dropDownList,
this.dropdownIndexValue,
this.dropDownIndexChange,
this.onTap,
appBar,
this.customAppBar,
this.isLocalLoader = false,
this.isshowBackButton = true,
this.backButtonTab,
this.changeCurrentTab,
this.currentTab,
this.isShowPharmacyAppbar = false,
this.isShowLanguageChanger = false,
this.resizeToAvoidBottomInset = false,
this.showCenteredLogo = false,
});
@override
_AppScaffoldState createState() => _AppScaffoldState();
@ -228,7 +231,7 @@ class _AppScaffoldState extends State<AppScaffold> {
return Scaffold(
backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
// appBar: widget.isShowPharmacyAppbar
// ? pharmacyAppbar()
// : widget.isShowAppBar
@ -251,6 +254,7 @@ resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
isShowBackButton: widget.isshowBackButton,
dropDownIndexChange: widget.dropDownIndexChange,
appBarIcons: widget.appBarIcons,
showCenterLogo: widget.showCenteredLogo,
isShowLanguageChanger: widget.isShowLanguageChanger,
onTap: () {
widget.onTap;
@ -356,6 +360,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
final void Function(int?)? dropDownIndexChange;
final List<Widget>? appBarIcons;
final bool isShowLanguageChanger;
final bool showCenterLogo;
String currentLang = 'ar';
@ -372,7 +377,8 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
this.dropDownIndexChange,
this.onTap,
this.isShowBackButton = true,
this.isShowLanguageChanger = false})
this.isShowLanguageChanger = false,
this.showCenterLogo = false})
: super(key: key);
@override
@ -389,12 +395,14 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
onTap: onTap,
)
: null,
// centerTitle: showCenterLogo,
titleSpacing: -8,
// centerTitle: false,
title: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (showCenterLogo) SvgPicture.asset('assets/images/svg/habiblogo.svg', height: 32, width: 32).withHorizontalPadding(25),
if (showTitle)
Expanded(
child: Text(
@ -443,7 +451,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
),
if (showDropDown! && isShowLanguageChanger)
Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
padding: EdgeInsets.symmetric(horizontal: 25),
child: Directionality(
textDirection: TextDirection.ltr,
child: LanguageSelector(
@ -545,7 +553,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
// ),
title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle!.toUpperCase() : TranslationBase.of(context).serviceInformationTitle,
// style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
style: TextStyle(fontWeight: FontWeight.bold, color: CustomColors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
style: TextStyle(fontWeight: FontWeight.bold, color: CustomColors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
leading: widget.isshowBackButton
? Builder(
builder: (BuildContext context) {

@ -4,6 +4,7 @@ import 'dart:io';
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/theme/colors.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
import 'package:hmg_patient_app/uitl/whatsapp_method_channel.dart';
@ -101,7 +102,7 @@ class SMSOTP {
}
return AppScaffold(
appBarTitle: "OTP Verification",
appBarTitle: TranslationBase.of(context).otpVerfication,
isShowDecPage: false,
isShowAppBar: true,
isshowBackButton: true,
@ -125,7 +126,7 @@ class SMSOTP {
SizedBox(height: 22),
Text(
TranslationBase.of(context).pleaseEnterTheVerificationCode + ' xxxxxxxx' + mobileNo.toString().substring(mobileNo.toString().length - 3),
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
@ -151,7 +152,6 @@ class SMSOTP {
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300),
pinBoxRadius: 18,
keyboardType: TextInputType.number,
),
),
@ -160,7 +160,7 @@ class SMSOTP {
RichText(
text: TextSpan(
text: TranslationBase.of(context).validationMessage + '\n',
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
@ -169,7 +169,7 @@ class SMSOTP {
children: <TextSpan>[
TextSpan(
text: displayTime,
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xffD02127),

@ -1,6 +1,7 @@
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/theme/colors.dart';
import 'package:hmg_patient_app/uitl/font_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -61,21 +62,23 @@ class _AppTextState extends State<AppText> {
widget.data,
textAlign: widget.textAlign,
overflow: TextOverflow.clip,
style: TextStyle(
style: context.dynamicTextStyle(
color: widget.color == null ? CustomColors.black : widget.color,
fontWeight: widget.fontWeight,
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier! * 2),
height: widget.height,
fontFamily: "Poppins",
// fontFamily: widget.fontFamily ?? Theme.of(context).textTheme.bodyLarge?.fontFamily,
letterSpacing: widget.letterSpacing,
// fontFamily: widget.fontFamily == null
// ? projectViewModel.isArabic
// ? 'Cairo'
// : 'WorkSans'
// : widget.fontFamily,
decoration: widget.underline == true ? TextDecoration.underline : TextDecoration.none
),
decoration: widget.underline == true ? TextDecoration.underline : TextDecoration.none),
// style: TextStyle(
// color: widget.color == null ? CustomColors.black : widget.color,
// fontWeight: widget.fontWeight,
// fontSize: widget.fontSize ?? (SizeConfig.textMultiplier! * 2),
// height: widget.height,
// fontFamily: widget.fontFamily ?? Theme.of(context).textTheme.bodyLarge?.fontFamily,
// letterSpacing: widget.letterSpacing,
// decoration: widget.underline == true ? TextDecoration.underline : TextDecoration.none
// ),
),
),
);

Loading…
Cancel
Save