merge-update-with-lab-changes
Aamir Muhammad 7 months ago committed by haroon amjad
parent ef8532b1c5
commit ee4ae657b0

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -27,6 +27,10 @@ android {
versionCode = flutter.versionCode versionCode = flutter.versionCode
versionName = flutter.versionName versionName = flutter.versionName
multiDexEnabled true multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
} }
buildFeatures { buildFeatures {
@ -71,7 +75,7 @@ android {
} }
packagingOptions { packagingOptions {
jniLibs { 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 useLegacyPackaging true
} }
resources { 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": "تسجيل الدخول الآن"}, "loginNow": {"en": "Login Now", "ar": "تسجيل الدخول الآن"},
"guest": {"en": "Guest", "ar":"ضيف"}, "guest": {"en": "Guest", "ar":"ضيف"},
"switchAccount": {"en": "Switch Account", "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":"تمكين تسجيل الدخول السريع"}, "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 الخاص بجهازك الحالي'"}, "enableMsg": {"en": "Enabling the quick login will verify through your existing device Face ID / Biometric", "ar":"'تمكين تسجيل الدخول السريع سيسمح بالتحقق من خلال Face ID / Biometric الخاص بجهازك الحالي'"},
"notNow": {"en": "Not Now", "ar":"ليس الآن"}, "notNow": {"en": "Not Now", "ar":"ليس الآن"},

@ -16,6 +16,7 @@ class GenericBottomSheet extends StatefulWidget {
Function(Country)? onCountryChange; Function(Country)? onCountryChange;
final bool isEnableCountryDropdown; final bool isEnableCountryDropdown;
final bool isFromSavedLogin; final bool isFromSavedLogin;
Function(String?)? onChange;
GenericBottomSheet( GenericBottomSheet(
{Key? key, {Key? key,
@ -26,7 +27,8 @@ class GenericBottomSheet extends StatefulWidget {
this.isForEmail = false, this.isForEmail = false,
this.onCountryChange, this.onCountryChange,
this.isEnableCountryDropdown = false, this.isEnableCountryDropdown = false,
this.isFromSavedLogin = false}) this.isFromSavedLogin = false,
this.onChange})
: super(key: key); : super(key: key);
@override @override
@ -34,7 +36,7 @@ class GenericBottomSheet extends StatefulWidget {
} }
class _GenericBottomSheetState extends State<GenericBottomSheet> { class _GenericBottomSheetState extends State<GenericBottomSheet> {
FocusNode node = FocusNode(); // FocusNode node = FocusNode();
@override @override
void initState() { void initState() {
@ -43,16 +45,9 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
widget.textController = TextEditingController(text: widget.initialPhoneNumber); widget.textController = TextEditingController(text: widget.initialPhoneNumber);
} }
WidgetsBinding.instance.addPostFrameCallback((_) { // WidgetsBinding.instance.addPostFrameCallback((_) {
print("GenericBottomSheet initState called"); // FocusScope.of(context).requestFocus(node);
FocusScope.of(context).requestFocus(node); // });
// if (widget.textController != null) {
//
// widget.textController!.selection = TextSelection.fromPosition(
// TextPosition(offset: widget.textController!.text.length),
// );
// }
});
} }
@override @override
@ -63,7 +58,7 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside
}, },
child: Builder(builder: (context) { child: Builder(builder: (context) {
final isRtl = Directionality.of(context) == TextDirection.rtl; // final isRtl = Directionality.of(context) == TextDirection.rtl;
return Directionality( return Directionality(
textDirection: Directionality.of(context), textDirection: Directionality.of(context),
child: Container( child: Container(
@ -99,29 +94,35 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
newInputWidget( Directionality(
widget.isForEmail ? TranslationBase.of(context).email : TranslationBase.of(context).phoneNumber, textDirection: TextDirection.ltr,
widget.isForEmail ? "demo@gmail.com" : "5xxxxxxxx", child: newInputWidget(
widget.textController!, widget.isForEmail ? TranslationBase.of(context).email : TranslationBase.of(context).phoneNumber,
padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8), widget.isForEmail ? "demo@gmail.com" : "5xxxxxxxx",
keyboardType: widget.isForEmail ? TextInputType.emailAddress : TextInputType.number, widget.textController!,
onChange: (value) { padding: EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8),
widget.textController!.text = value!; keyboardType: widget.isForEmail ? TextInputType.emailAddress : TextInputType.number,
}, onChange: (value) {
isEnable: true, widget.textController!.text = value!;
focusNode: node, if (widget.onChange != null) {
autoFocus: true, widget.onChange!(value);
isReadOnly: widget.isFromSavedLogin, }
prefix: widget.isForEmail ? null : widget.countryCode, },
hasSelection: false, isEnable: true,
isBorderAllowed: false, // focusNode: node,
isAllowLeadingIcon: true, autoFocus: true,
countryList: Country.values, isReadOnly: widget.isFromSavedLogin,
isCountryDropDown: widget.isEnableCountryDropdown, prefix: widget.isForEmail ? null : widget.countryCode,
onCountryChange: (Country country) { hasSelection: false,
widget.onCountryChange!(country); isBorderAllowed: false,
}, isAllowLeadingIcon: true,
leadingIcon: widget.isForEmail ? "assets/images/svg/email.svg" : "assets/images/svg/smart-phone.svg", 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( Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isRtl ? CrossAxisAlignment.end : CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Directionality( Directionality(
textDirection: Directionality.of(context), textDirection: Directionality.of(context),
@ -596,222 +596,219 @@ Widget newInputWidget(
}) { }) {
return Builder( return Builder(
builder: (context) { builder: (context) {
final isRtl = Directionality.of(context) == TextDirection.rtl; // final isRtl = Directionality.of(context) == TextDirection.ltr;
return Directionality( return Container(
textDirection: Directionality.of(context), padding: padding,
child: Container( // padding: removePadding && isAllowLeadingIcon && prefix == null
padding: padding, // ? const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8)
// padding: removePadding && isAllowLeadingIcon && prefix == null // : removePadding && !hasSelection
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 8, right: 8) // ? const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0)
// : removePadding && !hasSelection // : removePadding && hasSelection
// ? const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0) // ? null
// : removePadding && hasSelection // : const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
// ? null alignment: Alignment.center,
// : const EdgeInsets.symmetric(horizontal: 16, vertical: 15), decoration: BoxDecoration(
alignment: Alignment.center, borderRadius: isAllowRadius ? BorderRadius.circular(15) : null,
decoration: BoxDecoration( color: Colors.white,
borderRadius: isAllowRadius ? BorderRadius.circular(15) : null, border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null,
color: Colors.white, ),
border: isBorderAllowed ? Border.all(color: const Color(0xffefefef), width: 1) : null, child: Row(
), textDirection: Directionality.of(context),
child: Row( children: [
textDirection: Directionality.of(context), if (isAllowLeadingIcon && leadingIcon != null)
children: [ isCountryDropDown
if (isAllowLeadingIcon && leadingIcon != null) ? _CustomCountryDropdown(
isCountryDropDown logo: SvgPicture.asset(
? _CustomCountryDropdown( prefix == "966" ? "assets/images/svg/ksa.svg" : "assets/images/svg/uae.svg",
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,
width: 40, width: 40,
margin: isRtl ? const EdgeInsets.only(left: 10) : const EdgeInsets.only(right: 10), height: 40,
padding: isLeadingCountry ? null : const EdgeInsets.all(8), fit: BoxFit.cover,
decoration: const BoxDecoration(
color: Color(0xFFEFEFF0),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: SvgPicture.asset(
leadingIcon,
width: 24,
height: 24,
fit: BoxFit.cover,
),
), ),
Expanded( countryList: countryList,
child: Column( onCountryChange: onCountryChange,
mainAxisSize: MainAxisSize.min, isRtl: Directionality.of(context) == TextDirection.rtl,
crossAxisAlignment: CrossAxisAlignment.start, )
children: [ : Container(
Text( height: 40,
_labelText, width: 40,
style: context.dynamicTextStyle( margin: const EdgeInsets.only(right: 10),
fontSize: 12, padding: isLeadingCountry ? null : const EdgeInsets.all(8),
fontWeight: FontWeight.w500, decoration: const BoxDecoration(
color: const Color(0xff898A8D), color: Color(0xFFEFEFF0),
letterSpacing: -0.2, borderRadius: BorderRadius.all(Radius.circular(10)),
height: 18 / 12, ),
child: SvgPicture.asset(
leadingIcon,
width: 24,
height: 24,
fit: BoxFit.cover,
), ),
), ),
hasSelection Expanded(
? GestureDetector( child: Column(
onTap: isEnable && !isReadOnly mainAxisSize: MainAxisSize.min,
? () async { crossAxisAlignment: CrossAxisAlignment.start,
if (selectionType == SelectionType.dropdown) { children: [
final renderBox = context.findRenderObject() as RenderBox; Text(
final offset = renderBox.localToGlobal(Offset.zero); _labelText,
final selected = await showMenu<String>( style: context.dynamicTextStyle(
context: context, fontSize: 12,
position: RelativeRect.fromLTRB( fontWeight: FontWeight.w500,
offset.dx, color: const Color(0xff898A8D),
offset.dy + renderBox.size.height, letterSpacing: -0.2,
offset.dx + renderBox.size.width, height: 18 / 12,
0, ),
), ),
items: dropdownItems hasSelection
?.map( ? GestureDetector(
(e) => PopupMenuItem<String>( onTap: isEnable && !isReadOnly
value: e, ? () async {
child: Text(e), if (selectionType == SelectionType.dropdown) {
), final renderBox = context.findRenderObject() as RenderBox;
) final offset = renderBox.localToGlobal(Offset.zero);
.toList() ?? final selected = await showMenu<String>(
[], context: context,
shape: RoundedRectangleBorder( position: RelativeRect.fromLTRB(
borderRadius: BorderRadius.circular(12), 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) { if (selected != null && onChange != null) {
onChange(selected); onChange(selected);
} }
} else if (selectionType == SelectionType.calendar) { } else if (selectionType == SelectionType.calendar) {
bool isGregorian = true; bool isGregorian = true;
// final picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2100)); // final picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2100));
final picked = await showHijriGregBottomSheet( final picked = await showHijriGregBottomSheet(
context, context,
switcherIcon: SvgPicture.asset("assets/images/svg/language.svg", width: 24), switcherIcon: SvgPicture.asset("assets/images/svg/language.svg", width: 24),
// fontFamily: FontUtils.getFontFamily(context), // fontFamily: FontUtils.getFontFamily(context),
language: lang, language: lang,
initialDate: DateTime.now(), initialDate: DateTime.now(),
okWidget: Padding( okWidget: Padding(
padding: const EdgeInsets.only(right: 8.0), padding: const EdgeInsets.only(right: 8.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/images/svg/confirm.svg", "assets/images/svg/confirm.svg",
width: 24, width: 24,
height: 24, height: 24,
),
), ),
cancelWidget: Padding( ),
padding: const EdgeInsets.only(right: 8.0), cancelWidget: Padding(
child: SvgPicture.asset( padding: const EdgeInsets.only(right: 8.0),
"assets/images/svg/cancel.svg", child: SvgPicture.asset(
colorFilter: ColorFilter.mode( "assets/images/svg/cancel.svg",
Colors.white, colorFilter: ColorFilter.mode(
BlendMode.srcIn, Colors.white,
), BlendMode.srcIn,
width: 24,
height: 24,
), ),
width: 24,
height: 24,
), ),
onCalendarTypeChanged: (bool value) { ),
isGregorian = value; onCalendarTypeChanged: (bool value) {
}, isGregorian = value;
); },
if (picked != null && onChange != null) { );
print(picked.toIso8601String()); if (picked != null && onChange != null) {
if (onCalendarTypeChanged != null) { print(picked.toIso8601String());
print(isGregorian.toString()); if (onCalendarTypeChanged != null) {
onCalendarTypeChanged.call(isGregorian); print(isGregorian.toString());
} onCalendarTypeChanged.call(isGregorian);
onChange(picked.toIso8601String());
} }
onChange(picked.toIso8601String());
} }
} }
: null, }
child: Row( : null,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expanded( children: [
child: Text((selectedValue == null || selectedValue.isEmpty) ? _hintText : selectedValue, Expanded(
textAlign: isRtl ? TextAlign.right : TextAlign.left, child: Text((selectedValue == null || selectedValue.isEmpty) ? _hintText : selectedValue,
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr, textAlign: TextAlign.left,
style: context.dynamicTextStyle( textDirection: TextDirection.ltr,
fontSize: 14, style: context.dynamicTextStyle(
height: 21 / 14, fontSize: 14,
fontWeight: FontWeight.w500, height: 21 / 14,
color: (selectedValue != null && selectedValue.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0), fontWeight: FontWeight.w500,
letterSpacing: -0.2, 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) if (hasSelectionCustomIcon && selectionCustomIcon != null)
else SvgPicture.asset(selectionCustomIcon, width: 24, height: 24)
const Icon(Icons.keyboard_arrow_down_outlined), else
], const Icon(Icons.keyboard_arrow_down_outlined),
), ],
) ),
: TextField( )
enabled: isEnable, : TextField(
scrollPadding: EdgeInsets.zero, enabled: isEnable,
keyboardType: keyboardType, scrollPadding: EdgeInsets.zero,
controller: _controller, keyboardType: keyboardType,
readOnly: isReadOnly, controller: _controller,
textAlignVertical: TextAlignVertical.top, readOnly: isReadOnly,
textAlign: isRtl ? TextAlign.right : TextAlign.left, textAlignVertical: TextAlignVertical.top,
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr, textAlign: TextAlign.left,
onChanged: onChange, textDirection: TextDirection.ltr,
focusNode: focusNode, onChanged: onChange,
autofocus: autoFocus, focusNode: focusNode,
style: context.dynamicTextStyle( 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, fontSize: 14,
height: 21 / 14, height: 21 / 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: const Color(0xff2E3039), color: const Color(0xff898A8D),
letterSpacing: -0.2, letterSpacing: -0.2,
), ),
decoration: InputDecoration( prefixIconConstraints: const BoxConstraints(minWidth: 45),
isDense: true, prefixIcon: prefix == null
hintText: _hintText, ? null
hintStyle: context.dynamicTextStyle( : Text(
fontSize: 14, "+" + prefix,
height: 21 / 16, style: context.dynamicTextStyle(
fontWeight: FontWeight.w500, fontSize: 14,
color: const Color(0xff898A8D), height: 21 / 14,
letterSpacing: -0.2, fontWeight: FontWeight.w500,
), color: const Color(0xff2E303A),
prefixIconConstraints: const BoxConstraints(minWidth: 45), letterSpacing: -0.2,
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, contentPadding: EdgeInsets.zero,
focusedBorder: InputBorder.none, border: InputBorder.none,
enabledBorder: 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), padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 0),
child: Column( child: Column(
children: [ children: [
newInputWidget( Directionality(
TranslationBase.of(context).country, textDirection: TextDirection.ltr,
TranslationBase.of(context).ksa, child: newInputWidget(
nationalIDorFile, TranslationBase.of(context).country,
isEnable: true, TranslationBase.of(context).ksa,
prefix: null, nationalIDorFile,
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,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
hasSelection: true, 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, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
selectionType: SelectionType.calendar, removePadding: true,
selectedValue: selectedDOB != null ? Utils.formatDateToDisplay(selectedDOB.toString()) : null, isLeadingCountry: true,
selectionCustomIcon: "assets/images/svg/calendar.svg", isAllowRadius: false,
lang: context.selectedLanguage,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
leadingIcon: "assets/images/svg/birthday-cake.svg", onChange: (value) { selectionCustomIcon: "assets/images/svg/arrow-down.svg",
selectedDOB = DateTime.parse(value!); leadingIcon: selectedCountry.iconPath,
setState(() {}); ).withVerticalPadding(8),
}, onCalendarTypeChanged: (bool value) { ),
if (value) { Divider(height: 1),
isHijri = 0; Directionality(
} else { textDirection: TextDirection.ltr,
isHijri = 1; child: newInputWidget(TranslationBase.of(context).nationalIdNumber, "1xxxxxxxx", nationalIDorFile,
} isEnable: true,
}).withVerticalPadding(8), 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, countryCode: selectedCountry.countryCode,
initialPhoneNumber: "", initialPhoneNumber: "",
textController: phoneController, textController: phoneController,
onChange: (String? value) {
mobileNo = value!;
},
buttons: [ buttons: [
Padding( Padding(
padding: const EdgeInsets.only(bottom: 10), padding: const EdgeInsets.only(bottom: 10),
child: CustomButton( child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS, text: TranslationBase.of(context).sendOTPSMS,
onPressed: () { onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, phoneController); int? val = Utils.onOtpBtnPressed(OTPType.sms, mobileNo);
registerUser(val); registerUser(val);
//if (val != null) checkUserAuthentication(val);
}, },
backgroundColor: CustomColors.bgRedColor, backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor, borderColor: CustomColors.bgRedBorderColor,
@ -329,7 +340,7 @@ class _RegisterNew extends State<RegisterNew> {
child: CustomButton( child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP, text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () { onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, phoneController); int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, mobileNo);
registerUser(val); registerUser(val);
// if (val != null) checkUserAuthentication(val); // if (val != null) checkUserAuthentication(val);
}, },
@ -450,12 +461,12 @@ class _RegisterNew extends State<RegisterNew> {
print("nationalId: ${nationalIDorFile.text}"); print("nationalId: ${nationalIDorFile.text}");
print("DOB: ${selectedDOB}"); print("DOB: ${selectedDOB}");
if (value == 1) { if (value == 1) {
print("OTP sent successfully to ${phoneController.text} using SMS"); print("OTP sent successfully to ${mobileNo} using SMS");
} else { } 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); startRegistration(value);
// Navigator.of(context).push(FadePage(page: RegisterNewStep2())); // Navigator.of(context).push(FadePage(page: RegisterNewStep2()));
@ -698,7 +709,7 @@ class _RegisterNew extends State<RegisterNew> {
smsOtp = SMSOTP( smsOtp = SMSOTP(
context, context,
type, type,
phoneController.text, mobileNo,
(code) { (code) {
smsOtp.dispose(); // Now we can reference it smsOtp.dispose(); // Now we can reference it
this.checkActivationCode(value: code, type: type); this.checkActivationCode(value: code, type: type);

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

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

@ -28,13 +28,25 @@ class ReminderPage extends StatefulWidget {
late DateTime startDay; late DateTime startDay;
late DateTime endDay; 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}) { ReminderPage({Key? key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now(); startDay = DateTime.now();
endDay = DateTime.now().add(Duration(days: days!)); endDay = DateTime.now().add(Duration(days: days ?? 0));
int hour = (24 ~/ frequency!).round(); if (frequency != null && frequency! > 0) {
int durations = 24 ~/ hour; int hour = (24 ~/ frequency!).round();
for (int count = 0; count < durations; count++) { int durations = 24 ~/ hour;
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count))); 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 } enum MaritalStatusType { single, married, divorced, widowed }
class Utils { class Utils {
static int? onOtpBtnPressed(OTPType type, TextEditingController controller) { static int? onOtpBtnPressed(OTPType type, String? phoneNumber) {
if (controller.text.isEmpty) { if (phoneNumber == null || phoneNumber.isEmpty) {
Utils.showErrorToast("Please enter your phone number."); Utils.showErrorToast("Please enter your phone number.");
return null; return null;
} }
// if (type == OTPType.whatsapp && !controller.text.startsWith("+966")) {
// Utils.showErrorToast("WhatsApp OTP requires a phone number starting with +966."); print("Requesting OTP for ${phoneNumber} via ${type == OTPType.whatsapp ? "WhatsApp" : "SMS"} and ");
// return null;
//}
print("Requesting OTP for ${controller.text} via ${type == OTPType.whatsapp ? "WhatsApp" : "SMS"} and "
//$"{nationIdController.text}"
);
return type == OTPType.sms ? 1 : 4; return type == OTPType.sms ? 1 : 4;
} }
@ -1256,13 +1249,17 @@ extension SelectedLanguageExtension on BuildContext {
} }
double getLottieScaledWidth(double value) => MediaQuery.of(this).size.width * (value / MediaQuery.of(this).size.width); 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); double getLottieScaledHeight(double value) => MediaQuery.of(this).size.height * (value / MediaQuery.of(this).size.height);
} }
extension GenderTypeExtension on GenderType { extension GenderTypeExtension on GenderType {
String get value => this == GenderType.male ? "M" : "F"; String get value => this == GenderType.male ? "M" : "F";
String get type => this == GenderType.male ? "Male" : "Female"; String get type => this == GenderType.male ? "Male" : "Female";
String get typeAr => this == GenderType.male ? "ذكر" : "أنثى"; String get typeAr => this == GenderType.male ? "ذكر" : "أنثى";
static GenderType? fromValue(String? value) { static GenderType? fromValue(String? value) {
switch (value) { switch (value) {
case "M": case "M":
@ -1284,11 +1281,8 @@ extension GenderTypeExtension on GenderType {
return null; return null;
} }
} }
} }
extension MaritalStatusTypeExtension on MaritalStatusType { extension MaritalStatusTypeExtension on MaritalStatusType {
String get value { String get value {
switch (this) { switch (this) {
@ -1344,7 +1338,6 @@ extension MaritalStatusTypeExtension on MaritalStatusType {
} }
} }
static MaritalStatusType? fromType(String? type) { static MaritalStatusType? fromType(String? type) {
switch (type) { switch (type) {
case "Single": case "Single":
@ -1361,8 +1354,6 @@ extension MaritalStatusTypeExtension on MaritalStatusType {
} }
} }
/* /*
userBoard.asMap().map((i, element) => MapEntry(i, Stack( userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () { GestureDetector(onTap: () {

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

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

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

Loading…
Cancel
Save