updare-to-3.32.sultan
Aamir Muhammad 3 months ago
parent dd97a27494
commit fd0635764d

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -27,6 +27,10 @@ android {
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildFeatures {
@ -71,7 +75,7 @@ android {
}
packagingOptions {
jniLibs {
pickFirsts += ['lib/x86/libc++_shared.so', 'lib/x86_64/libc++_shared.so', 'lib/armeabi-v7a/libc++_shared.so', 'lib/arm64-v8a/libc++_shared.so', '**/*.so']
pickFirsts += ['**/libc++_shared.so', '**/libzoom_util.so', '**/libzoom_video_sdk.so', '**/libzoom_annotation.so', '**/libzoom_videoeffects.so']
useLegacyPackaging true
}
resources {

@ -0,0 +1,4 @@
storePassword=HmGsa123
keyPassword=HmGsa123
keyAlias=key
storeFile=DQKey.jks

@ -2336,7 +2336,7 @@ const Map localizedValues = {
"loginNow": {"en": "Login Now", "ar": "تسجيل الدخول الآن"},
"guest": {"en": "Guest", "ar":"ضيف"},
"switchAccount": {"en": "Switch Account", "ar":"تبديل الحساب"},
"allSet": {"en": "All Set! Now you can login with Face ID or Biometric", "ar":"جاهز! الآن يمكنك تسجيل الدخول باستخدام Face ID أو البصمة"},
"allSet": {"en": "All Set! Now you can login with Face ID or Biometric", "ar":"جاهز! الآن يمكنك تسجيل الدخول باستخدام Face ID / Biometric أو البصمة"},
"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":"ليس الآن"},

@ -16,6 +16,7 @@ class GenericBottomSheet extends StatefulWidget {
Function(Country)? onCountryChange;
final bool isEnableCountryDropdown;
final bool isFromSavedLogin;
Function(String?)? onChange;
GenericBottomSheet(
{Key? key,
@ -26,7 +27,8 @@ class GenericBottomSheet extends StatefulWidget {
this.isForEmail = false,
this.onCountryChange,
this.isEnableCountryDropdown = false,
this.isFromSavedLogin = false})
this.isFromSavedLogin = false,
this.onChange})
: super(key: key);
@override
@ -34,7 +36,7 @@ class GenericBottomSheet extends StatefulWidget {
}
class _GenericBottomSheetState extends State<GenericBottomSheet> {
FocusNode node = FocusNode();
// FocusNode node = FocusNode();
@override
void initState() {
@ -43,16 +45,9 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
widget.textController = TextEditingController(text: widget.initialPhoneNumber);
}
WidgetsBinding.instance.addPostFrameCallback((_) {
print("GenericBottomSheet initState called");
FocusScope.of(context).requestFocus(node);
// if (widget.textController != null) {
//
// widget.textController!.selection = TextSelection.fromPosition(
// TextPosition(offset: widget.textController!.text.length),
// );
// }
});
// WidgetsBinding.instance.addPostFrameCallback((_) {
// FocusScope.of(context).requestFocus(node);
// });
}
@override
@ -63,7 +58,7 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside
},
child: Builder(builder: (context) {
final isRtl = Directionality.of(context) == TextDirection.rtl;
// final isRtl = Directionality.of(context) == TextDirection.rtl;
return Directionality(
textDirection: Directionality.of(context),
child: Container(
@ -99,29 +94,35 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
? 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,
focusNode: node,
autoFocus: true,
isReadOnly: widget.isFromSavedLogin,
prefix: widget.isForEmail ? null : widget.countryCode,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
countryList: Country.values,
isCountryDropDown: widget.isEnableCountryDropdown,
onCountryChange: (Country country) {
widget.onCountryChange!(country);
},
leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg",
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!;
if (widget.onChange != null) {
widget.onChange!(value);
}
},
isEnable: true,
// focusNode: node,
autoFocus: true,
isReadOnly: widget.isFromSavedLogin,
prefix: widget.isForEmail ? null : widget.countryCode,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
countryList: Country.values,
isCountryDropDown: widget.isEnableCountryDropdown,
onCountryChange: (Country country) {
widget.onCountryChange!(country);
},
leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg",
),
),
],
)

@ -369,7 +369,7 @@ Widget inputWidget(
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isRtl ? CrossAxisAlignment.end : CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: Directionality.of(context),
@ -596,222 +596,219 @@ Widget newInputWidget(
}) {
return Builder(
builder: (context) {
final isRtl = Directionality.of(context) == TextDirection.rtl;
return Directionality(
textDirection: Directionality.of(context),
child: Container(
padding: padding,
// padding: removePadding && isAllowLeadingIcon && prefix == null
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8)
// : removePadding && !hasSelection
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0)
// : removePadding && hasSelection
// ? null
// : const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: isAllowRadius ? BorderRadius.circular(15) : null,
color: Colors.white,
border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null,
),
child: Row(
textDirection: Directionality.of(context),
children: [
if (isAllowLeadingIcon && leadingIcon != null)
isCountryDropDown
? _CustomCountryDropdown(
logo: SvgPicture.asset(
prefix == "966" ? "assets/images/svg/ksa.svg" : "assets/images/svg/uae.svg",
width: 40,
height: 40,
fit: BoxFit.cover,
),
countryList: countryList,
onCountryChange: onCountryChange,
isRtl: isRtl,
)
: Container(
height: 40,
// final isRtl = Directionality.of(context) == TextDirection.ltr;
return Container(
padding: padding,
// padding: removePadding && isAllowLeadingIcon && prefix == null
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8)
// : removePadding && !hasSelection
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0)
// : removePadding && hasSelection
// ? null
// : const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: isAllowRadius ? BorderRadius.circular(15) : null,
color: Colors.white,
border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null,
),
child: Row(
textDirection: Directionality.of(context),
children: [
if (isAllowLeadingIcon && leadingIcon != null)
isCountryDropDown
? _CustomCountryDropdown(
logo: SvgPicture.asset(
prefix == "966" ? "assets/images/svg/ksa.svg" : "assets/images/svg/uae.svg",
width: 40,
margin: isRtl ? const EdgeInsets.only(left: 10) : const EdgeInsets.only(right: 10),
padding: isLeadingCountry ? null : const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: Color(0xFFEFEFF0),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: SvgPicture.asset(
leadingIcon,
width: 24,
height: 24,
fit: BoxFit.cover,
),
height: 40,
fit: BoxFit.cover,
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: context.dynamicTextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: const Color(0xff898A8D),
letterSpacing: -0.2,
height: 18 / 12,
countryList: countryList,
onCountryChange: onCountryChange,
isRtl: Directionality.of(context) == TextDirection.rtl,
)
: Container(
height: 40,
width: 40,
margin: const EdgeInsets.only(right: 10),
padding: isLeadingCountry ? null : const EdgeInsets.all(8),
decoration: const BoxDecoration(
color: Color(0xFFEFEFF0),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: SvgPicture.asset(
leadingIcon,
width: 24,
height: 24,
fit: BoxFit.cover,
),
),
hasSelection
? GestureDetector(
onTap: isEnable && !isReadOnly
? () async {
if (selectionType == SelectionType.dropdown) {
final renderBox = context.findRenderObject() as RenderBox;
final offset = renderBox.localToGlobal(Offset.zero);
final selected = await showMenu<String>(
context: context,
position: RelativeRect.fromLTRB(
offset.dx,
offset.dy + renderBox.size.height,
offset.dx + renderBox.size.width,
0,
),
items: dropdownItems
?.map(
(e) => PopupMenuItem<String>(
value: e,
child: Text(e),
),
)
.toList() ??
[],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
);
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: context.dynamicTextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: const Color(0xff898A8D),
letterSpacing: -0.2,
height: 18 / 12,
),
),
hasSelection
? GestureDetector(
onTap: isEnable && !isReadOnly
? () async {
if (selectionType == SelectionType.dropdown) {
final renderBox = context.findRenderObject() as RenderBox;
final offset = renderBox.localToGlobal(Offset.zero);
final selected = await showMenu<String>(
context: context,
position: RelativeRect.fromLTRB(
offset.dx,
offset.dy + renderBox.size.height,
offset.dx + renderBox.size.width,
0,
),
items: dropdownItems
?.map(
(e) => PopupMenuItem<String>(
value: e,
child: Text(e),
),
)
.toList() ??
[],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
);
if (selected != null && onChange != null) {
onChange(selected);
}
} else if (selectionType == SelectionType.calendar) {
bool isGregorian = true;
// final picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2100));
final picked = await showHijriGregBottomSheet(
context,
switcherIcon: SvgPicture.asset("assets/images/svg/language.svg", width: 24),
// fontFamily: FontUtils.getFontFamily(context),
language: lang,
initialDate: DateTime.now(),
okWidget: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
"assets/images/svg/confirm.svg",
width: 24,
height: 24,
),
if (selected != null && onChange != null) {
onChange(selected);
}
} else if (selectionType == SelectionType.calendar) {
bool isGregorian = true;
// final picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2100));
final picked = await showHijriGregBottomSheet(
context,
switcherIcon: SvgPicture.asset("assets/images/svg/language.svg", width: 24),
// fontFamily: FontUtils.getFontFamily(context),
language: lang,
initialDate: DateTime.now(),
okWidget: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
"assets/images/svg/confirm.svg",
width: 24,
height: 24,
),
cancelWidget: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
"assets/images/svg/cancel.svg",
colorFilter: ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
width: 24,
height: 24,
),
cancelWidget: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset(
"assets/images/svg/cancel.svg",
colorFilter: ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
width: 24,
height: 24,
),
onCalendarTypeChanged: (bool value) {
isGregorian = value;
},
);
if (picked != null && onChange != null) {
print(picked.toIso8601String());
if (onCalendarTypeChanged != null) {
print(isGregorian.toString());
onCalendarTypeChanged.call(isGregorian);
}
onChange(picked.toIso8601String());
),
onCalendarTypeChanged: (bool value) {
isGregorian = value;
},
);
if (picked != null && onChange != null) {
print(picked.toIso8601String());
if (onCalendarTypeChanged != null) {
print(isGregorian.toString());
onCalendarTypeChanged.call(isGregorian);
}
onChange(picked.toIso8601String());
}
}
: null,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text((selectedValue == null || selectedValue.isEmpty) ? _hintText : selectedValue,
textAlign: isRtl ? TextAlign.right : TextAlign.left,
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
style: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: (selectedValue != null && selectedValue.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0),
letterSpacing: -0.2,
)),
),
if (hasSelectionCustomIcon && selectionCustomIcon != null)
SvgPicture.asset(selectionCustomIcon, width: 24, height: 24)
else
const Icon(Icons.keyboard_arrow_down_outlined),
],
),
)
: TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: keyboardType,
controller: _controller,
readOnly: isReadOnly,
textAlignVertical: TextAlignVertical.top,
textAlign: isRtl ? TextAlign.right : TextAlign.left,
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
onChanged: onChange,
focusNode: focusNode,
autofocus: autoFocus,
style: context.dynamicTextStyle(
}
: null,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text((selectedValue == null || selectedValue.isEmpty) ? _hintText : selectedValue,
textAlign: TextAlign.left,
textDirection: TextDirection.ltr,
style: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: (selectedValue != null && selectedValue.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0),
letterSpacing: -0.2,
)),
),
if (hasSelectionCustomIcon && selectionCustomIcon != null)
SvgPicture.asset(selectionCustomIcon, width: 24, height: 24)
else
const Icon(Icons.keyboard_arrow_down_outlined),
],
),
)
: TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: keyboardType,
controller: _controller,
readOnly: isReadOnly,
textAlignVertical: TextAlignVertical.top,
textAlign: TextAlign.left,
textDirection: TextDirection.ltr,
onChanged: onChange,
focusNode: focusNode,
autofocus: autoFocus,
style: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: const Color(0xff2E3039),
letterSpacing: -0.2,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
height: 21 / 16,
fontWeight: FontWeight.w500,
color: const Color(0xff2E3039),
color: const Color(0xff898A8D),
letterSpacing: -0.2,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 16,
fontWeight: FontWeight.w500,
color: const Color(0xff898A8D),
letterSpacing: -0.2,
),
prefixIconConstraints: const BoxConstraints(minWidth: 45),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: const Color(0xff2E303A),
letterSpacing: -0.2,
),
prefixIconConstraints: const BoxConstraints(minWidth: 45),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: context.dynamicTextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: const Color(0xff2E303A),
letterSpacing: -0.2,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
],
),
),
],
),
],
),
),
],
),
);
},

@ -150,71 +150,80 @@ class _RegisterNew extends State<RegisterNew> {
padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 0),
child: Column(
children: [
newInputWidget(
TranslationBase.of(context).country,
TranslationBase.of(context).ksa,
nationalIDorFile,
isEnable: true,
prefix: null,
hasSelection: true,
dropdownItems: Country.values.map((e) => context.selectedLanguage == "ar" ? e.nameArabic : e.displayName).toList(),
selectedValue: context.selectedLanguage == "ar" ? selectedCountry.nameArabic : selectedCountry.displayName,
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
print(val);
setState(() {
selectedCountry = CountryExtension.fromDisplayName(val);
});
}
},
isBorderAllowed: false,
isAllowLeadingIcon: true,
hasSelectionCustomIcon: true,
removePadding: true,
isLeadingCountry: true,
isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: "assets/images/svg/arrow-down.svg",
leadingIcon: selectedCountry.iconPath,
).withVerticalPadding(8),
Divider(height: 1),
newInputWidget(TranslationBase.of(context).nationalIdNumber, "1xxxxxxxx", nationalIDorFile,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/student-card.svg", onChange: (value) {
print(value);
}).withVerticalPadding(8),
Divider(height: 1),
newInputWidget(TranslationBase.of(context).dob, "11 July, 1994", nationalIDorFile,
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(
TranslationBase.of(context).country,
TranslationBase.of(context).ksa,
nationalIDorFile,
isEnable: true,
prefix: null,
hasSelection: true,
removePadding: true,
dropdownItems: Country.values.map((e) => context.selectedLanguage == "ar" ? e.nameArabic : e.displayName).toList(),
selectedValue: context.selectedLanguage == "ar" ? selectedCountry.nameArabic : selectedCountry.displayName,
selectionType: SelectionType.dropdown,
onChange: (val) {
if (val != null) {
print(val);
setState(() {
selectedCountry = CountryExtension.fromDisplayName(val);
});
}
},
isBorderAllowed: false,
isAllowLeadingIcon: true,
hasSelectionCustomIcon: true,
selectionType: SelectionType.calendar,
selectedValue: selectedDOB != null ? Utils.formatDateToDisplay(selectedDOB.toString()) : null,
selectionCustomIcon: "assets/images/svg/calendar.svg",
lang: context.selectedLanguage,
removePadding: true,
isLeadingCountry: true,
isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/birthday-cake.svg", onChange: (value) {
selectedDOB = DateTime.parse(value!);
setState(() {});
}, onCalendarTypeChanged: (bool value) {
if (value) {
isHijri = 0;
} else {
isHijri = 1;
}
}).withVerticalPadding(8),
selectionCustomIcon: "assets/images/svg/arrow-down.svg",
leadingIcon: selectedCountry.iconPath,
).withVerticalPadding(8),
),
Divider(height: 1),
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(TranslationBase.of(context).nationalIdNumber, "1xxxxxxxx", nationalIDorFile,
isEnable: true,
prefix: null,
removePadding: true,
isAllowRadius: false,
hasSelection: false,
isBorderAllowed: false,
isAllowLeadingIcon: true,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/student-card.svg", onChange: (value) {
print(value);
}).withVerticalPadding(8),
),
Divider(height: 1),
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(TranslationBase.of(context).dob, "11 July, 1994", nationalIDorFile,
isEnable: true,
prefix: null,
hasSelection: true,
removePadding: true,
isBorderAllowed: false,
isAllowLeadingIcon: true,
hasSelectionCustomIcon: true,
selectionType: SelectionType.calendar,
selectedValue: selectedDOB != null ? Utils.formatDateToDisplay(selectedDOB.toString()) : null,
selectionCustomIcon: "assets/images/svg/calendar.svg",
lang: context.selectedLanguage,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/birthday-cake.svg", onChange: (value) {
selectedDOB = DateTime.parse(value!);
setState(() {});
}, onCalendarTypeChanged: (bool value) {
if (value) {
isHijri = 0;
} else {
isHijri = 1;
}
}).withVerticalPadding(8),
),
],
),
),
@ -292,15 +301,17 @@ class _RegisterNew extends State<RegisterNew> {
countryCode: selectedCountry.countryCode,
initialPhoneNumber: "",
textController: phoneController,
onChange: (String? value) {
mobileNo = value!;
},
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.sms, mobileNo);
registerUser(val);
//if (val != null) checkUserAuthentication(val);
},
backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor,
@ -329,7 +340,7 @@ class _RegisterNew extends State<RegisterNew> {
child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, mobileNo);
registerUser(val);
// if (val != null) checkUserAuthentication(val);
},
@ -450,12 +461,12 @@ class _RegisterNew extends State<RegisterNew> {
print("nationalId: ${nationalIDorFile.text}");
print("DOB: ${selectedDOB}");
if (value == 1) {
print("OTP sent successfully to ${phoneController.text} using SMS");
print("OTP sent successfully to ${mobileNo} using SMS");
} else {
print("OTP sent successfully to ${phoneController.text} using Whatsapp");
print("OTP sent successfully to ${mobileNo} using Whatsapp");
}
mobileNo = phoneController.text;
// mobileNo = phoneController.text;
startRegistration(value);
// Navigator.of(context).push(FadePage(page: RegisterNewStep2()));
@ -698,7 +709,7 @@ class _RegisterNew extends State<RegisterNew> {
smsOtp = SMSOTP(
context,
type,
phoneController.text,
mobileNo,
(code) {
smsOtp.dispose(); // Now we can reference it
this.checkActivationCode(value: code, type: type);

@ -49,17 +49,23 @@ 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,
);
final authService = new AuthProvider();
TextEditingController? phoneController;
final authService = AuthProvider();
late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider;
Country selectedCountry = Country.saudiArabia;
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
String? phoneNumber;
@override
void initState() {
super.initState();
print("==== Saved Login=====");
phoneController = TextEditingController(text: widget.savedLoginData.mobile!.startsWith('0') ? widget.savedLoginData.mobile!.substring(1) : widget.savedLoginData.mobile);
phoneNumber = widget.savedLoginData.mobile!.startsWith('0') ? widget.savedLoginData.mobile!.substring(1) : widget.savedLoginData.mobile;
}
@override
Widget build(BuildContext context) {
@ -163,7 +169,7 @@ class _SavedLogin extends State<SavedLogin> {
margin: EdgeInsets.all(16),
child: SvgPicture.asset(
getTypeIcons(widget.savedLoginData.logInType!, context),
// color: Color(0xFFED1C2B),
color: widget.savedLoginData.logInType == 4 ? null: Color(0xFFED1C2B) ,
height: 64,
width: 64,
),
@ -219,7 +225,7 @@ class _SavedLogin extends State<SavedLogin> {
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: selectedCountry.countryCode,
initialPhoneNumber: phoneController.text,
initialPhoneNumber: phoneController!.text,
textController: phoneController,
isEnableCountryDropdown: false,
isFromSavedLogin: true,
@ -227,15 +233,20 @@ class _SavedLogin extends State<SavedLogin> {
selectedCountry = value;
setModalState(() {});
},
onChange: (String? value) {
phoneNumber = value;
},
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneNumber);
if (val != null) {
checkUserAuthentication(val,);
checkUserAuthentication(
val,
);
}
},
backgroundColor: CustomColors.bgRedColor,
@ -266,7 +277,7 @@ class _SavedLogin extends State<SavedLogin> {
child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneNumber);
if (val != null) {
GifLoaderDialogUtils.showMyDialog(context);
checkUserAuthentication(val);
@ -413,6 +424,19 @@ class _SavedLogin extends State<SavedLogin> {
// setDefault();
sharedPref.setInt(LAST_LOGIN, lastLogin);
checkActivationCode(null, lastLogin, result['LogInTokenID']);
}else if(result['ErrorEndUserMessage'] != null) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: result['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushReplacement(FadePage(page: WelcomeLogin())),
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -470,19 +494,16 @@ class _SavedLogin extends State<SavedLogin> {
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)
// }
else
{
// Navigator.of(context).pop(),
GifLoaderDialogUtils.hideDialog(context),
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result, localContext: context);
}),
projectViewModel.analytics.loginRegistration.login_fail(error: result),
projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result)
}
});
}
@ -624,8 +645,6 @@ class _SavedLogin extends State<SavedLogin> {
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
@ -634,13 +653,12 @@ class _SavedLogin extends State<SavedLogin> {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
},
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
projectViewModel.analytics.loginRegistration
.login_fail(error: err.toString());
projectViewModel.analytics.loginRegistration.login_fail(error: err.toString());
});
}
@ -697,7 +715,7 @@ class _SavedLogin extends State<SavedLogin> {
smsOtp = SMSOTP(
context,
type,
phoneController.text,
phoneController!.text,
(code) {
smsOtp.dispose(); // Now we can reference it
this.checkActivationCode(code, type, loginToken);

@ -49,7 +49,8 @@ class WelcomeLogin extends StatefulWidget {
class _WelcomeLogin extends State<WelcomeLogin> {
bool isLoading = true;
TextEditingController nationIdController = TextEditingController();
TextEditingController phoneController = TextEditingController();
TextEditingController? phoneController;
String? phoneNumber;
Country selectedCountry = Country.saudiArabia;
//checkUserAuthentication();
@ -91,6 +92,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
void initState() {
isLoading = true;
super.initState();
phoneController = TextEditingController();
}
@override
@ -158,18 +160,21 @@ class _WelcomeLogin extends State<WelcomeLogin> {
),
),
SizedBox(height: 32),
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",
Directionality(
textDirection: TextDirection.ltr,
child: newInputWidget(
TranslationBase.of(context).idNo + " / " + TranslationBase.of(context).fileNo,
"xxxxxxxxx",
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(
@ -189,21 +194,23 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: SingleChildScrollView(
child: GenericBottomSheet(
countryCode: selectedCountry.countryCode,
initialPhoneNumber: "",
initialPhoneNumber: phoneNumber != null ? phoneNumber :"",
textController: phoneController,
isEnableCountryDropdown: true,
onCountryChange: (value) {
print(value);
selectedCountry = value;
setModalState(() {});
},
onChange: (String? value) {
phoneNumber = value;
},
buttons: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneNumber);
if (val != null) checkUserAuthentication(val);
},
backgroundColor: CustomColors.bgRedColor,
@ -232,7 +239,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController);
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneNumber);
if (val != null) checkUserAuthentication(val);
},
backgroundColor: Colors.white,
@ -329,13 +336,12 @@ class _WelcomeLogin extends State<WelcomeLogin> {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
},
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
projectViewModel.analytics.loginRegistration
.login_fail(error: err.toString());
projectViewModel.analytics.loginRegistration.login_fail(error: err.toString());
});
}
@ -496,7 +502,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
smsOtp = SMSOTP(
context,
type,
phoneController.text,
phoneNumber,
(code) {
smsOtp.dispose(); // Now we can reference it
this.checkActivationCode(value: code);
@ -567,8 +573,8 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
var request = SendActivationRequest();
request.patientMobileNumber = int.parse(phoneController.text);
request.mobileNo = '0' + phoneController.text.toString();
request.patientMobileNumber = int.parse(phoneNumber!);
request.mobileNo = '0' + phoneNumber.toString();
request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = type == 1 ? type : 2;

@ -28,13 +28,25 @@ class ReminderPage extends StatefulWidget {
late DateTime startDay;
late DateTime endDay;
// ReminderPage({Key? key, this.frequency, this.days, this.itemDescription}) {
// startDay = DateTime.now();
// endDay = DateTime.now().add(Duration(days: days!));
// int hour = (24 ~/ frequency!).round();
// int durations = 24 ~/ hour;
// for (int count = 0; count < durations; count++) {
// _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count)));
// }
// }
ReminderPage({Key? key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now();
endDay = DateTime.now().add(Duration(days: days!));
int hour = (24 ~/ frequency!).round();
int durations = 24 ~/ hour;
for (int count = 0; count < durations; count++) {
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count)));
endDay = DateTime.now().add(Duration(days: days ?? 0));
if (frequency != null && frequency! > 0) {
int hour = (24 ~/ frequency!).round();
int durations = 24 ~/ hour;
for (int count = 0; count < durations; count++) {
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count)));
}
}
}

@ -76,21 +76,14 @@ enum GenderType { male, female }
enum MaritalStatusType { single, married, divorced, widowed }
class Utils {
static int? onOtpBtnPressed(OTPType type, TextEditingController controller) {
if (controller.text.isEmpty) {
static int? onOtpBtnPressed(OTPType type, String? phoneNumber) {
if (phoneNumber == null || phoneNumber.isEmpty) {
Utils.showErrorToast("Please enter your phone number.");
return null;
}
// if (type == OTPType.whatsapp && !controller.text.startsWith("+966")) {
// Utils.showErrorToast("WhatsApp OTP requires a phone number starting with +966.");
// return null;
//}
print("Requesting OTP for ${controller.text} via ${type == OTPType.whatsapp ? "WhatsApp" : "SMS"} and "
//$"{nationIdController.text}"
);
print("Requesting OTP for ${phoneNumber} via ${type == OTPType.whatsapp ? "WhatsApp" : "SMS"} and ");
return type == OTPType.sms ? 1 : 4;
}
@ -1266,13 +1259,17 @@ extension SelectedLanguageExtension on BuildContext {
}
double getLottieScaledWidth(double value) => MediaQuery.of(this).size.width * (value / MediaQuery.of(this).size.width);
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":
@ -1294,11 +1291,8 @@ extension GenderTypeExtension on GenderType {
return null;
}
}
}
extension MaritalStatusTypeExtension on MaritalStatusType {
String get value {
switch (this) {
@ -1354,7 +1348,6 @@ extension MaritalStatusTypeExtension on MaritalStatusType {
}
}
static MaritalStatusType? fromType(String? type) {
switch (type) {
case "Single":
@ -1371,8 +1364,6 @@ extension MaritalStatusTypeExtension on MaritalStatusType {
}
}
/*
userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () {

@ -131,24 +131,23 @@ class SMSOTP {
SizedBox(height: 18),
Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: OTPWidget(
autoFocus: true,
controller: _pinPutController,
defaultBorderColor: Color(0xffffffff),
maxLength: 4,
onTextChanged: (text) {},
pinBoxColor: Colors.white,
onDone: (code) => _onOtpCallBack(code, false),
textBorderColor: Color(0xffffff),
pinBoxWidth: 76,
pinBoxHeight: 94,
pinTextStyle: TextStyle(fontSize: 24.0, color: Color(0xff2B353E)),
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300),
pinBoxRadius: 18,
keyboardType: TextInputType.number,
),
child: OTPWidget(
autoFocus: true,
controller: _pinPutController,
defaultBorderColor: Color(0xffffffff),
maxLength: 4,
onTextChanged: (text) {},
pinBoxColor: Colors.white,
onDone: (code) => _onOtpCallBack(code, false),
textBorderColor: Color(0xffffff),
pinBoxWidth: 76,
pinBoxHeight: 94,
pinTextStyle: TextStyle(fontSize: 24.0, color: Color(0xff2B353E)),
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300),
pinBoxRadius: 18,
keyboardType: TextInputType.number,
),
),
SizedBox(height: 30),

@ -235,9 +235,13 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
enableInteractiveSelection: false,
focusNode: focusNode,
controller: widget.controller,
textAlign: TextAlign.center,
keyboardType: widget.keyboardType,
inputFormatters: widget.keyboardType == TextInputType.number ? <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly] : null,
style: TextStyle(height: 0.1, color: Colors.transparent),
style: TextStyle(
height: 0.5,
color: Colors.transparent,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.all(0),
focusedErrorBorder: transparentBorder,
@ -250,7 +254,8 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
helperStyle: TextStyle(height: 0.0, color: Colors.transparent),
labelStyle: TextStyle(height: 0.1),
fillColor: Colors.transparent,
border: InputBorder.none),
border: InputBorder.none,
isDense: true),
cursorColor: Colors.transparent,
showCursor: false,
maxLength: widget.maxLength,
@ -294,6 +299,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
children: pinCodes,
mainAxisSize: MainAxisSize.min, // Important when inside a scroll view
mainAxisAlignment: MainAxisAlignment.start, // Or another suitable alignment
crossAxisAlignment: CrossAxisAlignment.center,
),
);
}
@ -338,12 +344,10 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
key: ValueKey<String>("container$i"),
alignment: Alignment.center,
margin: widget.pinBoxOuterPadding,
padding: EdgeInsets.zero,
decoration: BoxDecoration(
color: bgColor,
border: Border.all(
color: borderColor,
width: widget.pinBoxBorderWidth,
),
border: Border.all(color: borderColor, width: 1),
borderRadius: BorderRadius.circular(16), // Rounded edges
),
width: widget.pinBoxWidth,
@ -432,7 +436,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
Widget _animatedTextBox(String text, int i, Color textColor) {
final bool isFilled = text.isNotEmpty;
final double fontSize = isFilled ? 64 : 64; // Increased when filled
final double fontSize = isFilled ? 50 : 50;
final FontWeight fontWeight = isFilled ? FontWeight.w600 : FontWeight.normal;
if (widget.pinTextAnimatedSwitcherTransition != null) {
@ -441,14 +445,16 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
transitionBuilder: widget.pinTextAnimatedSwitcherTransition!,
child: Text(
text,
softWrap: true,
key: ValueKey<String>("$text$i"),
style: widget.pinTextStyle?.copyWith(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily) ??
TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily),
TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily, ),
),
);
} else {
return Text(
text,
softWrap: true,
key: ValueKey<String>("${strList[i]}$i"),
style: widget.pinTextStyle?.copyWith(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily) ??
TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily),

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app/new_ui/otp/otp_validation_bootmsheet_widget.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/widgets/buttons/defaultButton.dart';
@ -45,11 +46,10 @@ class _QuickLoginBottomSheet extends State<QuickLoginBottomSheet> {
Text(
TranslationBase.of(context).allSet,
textAlign: TextAlign.center,
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black,
fontFamily: 'Poppins',
),
),
@ -63,7 +63,7 @@ class _QuickLoginBottomSheet extends State<QuickLoginBottomSheet> {
const SizedBox(height: 10),
Text(
TranslationBase.of(context).enableQuickLogin,
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
color: Colors.black,
@ -75,7 +75,7 @@ class _QuickLoginBottomSheet extends State<QuickLoginBottomSheet> {
// Description
Text(
TranslationBase.of(context).enableMsg,
style: TextStyle(
style: context.dynamicTextStyle(
fontSize: 16,
color: Color(0xFF666666),
height: 1.5,

Loading…
Cancel
Save