chore: clean up unused imports, update routing for authentication pages, and enhance UI components in the profile and captcha widgets

This commit is contained in:
2025-12-24 11:51:41 +03:30
parent 3eccf492ff
commit 60c58ef17e
17 changed files with 428 additions and 625 deletions

View File

@@ -49,6 +49,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/bg_auth.svg
SvgGenImage get bgAuth => const SvgGenImage('assets/icons/bg_auth.svg');
/// File path: assets/icons/bg_auth_dam.svg
SvgGenImage get bgAuthDam => const SvgGenImage('assets/icons/bg_auth_dam.svg');
/// File path: assets/icons/bg_header_user_profile.svg
SvgGenImage get bgHeaderUserProfile => const SvgGenImage('assets/icons/bg_header_user_profile.svg');
@@ -163,6 +166,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/cube_watting.svg
SvgGenImage get cubeWatting => const SvgGenImage('assets/icons/cube_watting.svg');
/// File path: assets/icons/dam_pattern.svg
SvgGenImage get damPattern => const SvgGenImage('assets/icons/dam_pattern.svg');
/// File path: assets/icons/diagram.svg
SvgGenImage get diagram => const SvgGenImage('assets/icons/diagram.svg');
@@ -396,6 +402,7 @@ class $AssetsIconsGen {
arrowLeft,
arrowRight,
bgAuth,
bgAuthDam,
bgHeaderUserProfile,
boxRemove,
boxTick,
@@ -434,6 +441,7 @@ class $AssetsIconsGen {
cubeSearch,
cubeTopRotation,
cubeWatting,
damPattern,
diagram,
directPurchase,
download,
@@ -568,6 +576,9 @@ class $AssetsVecGen {
/// File path: assets/vec/bg_auth.svg.vec
SvgGenImage get bgAuthSvg => const SvgGenImage.vec('assets/vec/bg_auth.svg.vec');
/// File path: assets/vec/bg_auth_dam.svg.vec
SvgGenImage get bgAuthDamSvg => const SvgGenImage.vec('assets/vec/bg_auth_dam.svg.vec');
/// File path: assets/vec/bg_header_user_profile.svg.vec
SvgGenImage get bgHeaderUserProfileSvg => const SvgGenImage.vec('assets/vec/bg_header_user_profile.svg.vec');
@@ -682,6 +693,9 @@ class $AssetsVecGen {
/// File path: assets/vec/cube_watting.svg.vec
SvgGenImage get cubeWattingSvg => const SvgGenImage.vec('assets/vec/cube_watting.svg.vec');
/// File path: assets/vec/dam_pattern.svg.vec
SvgGenImage get damPatternSvg => const SvgGenImage.vec('assets/vec/dam_pattern.svg.vec');
/// File path: assets/vec/diagram.svg.vec
SvgGenImage get diagramSvg => const SvgGenImage.vec('assets/vec/diagram.svg.vec');
@@ -915,6 +929,7 @@ class $AssetsVecGen {
arrowLeftSvg,
arrowRightSvg,
bgAuthSvg,
bgAuthDamSvg,
bgHeaderUserProfileSvg,
boxRemoveSvg,
boxTickSvg,
@@ -953,6 +968,7 @@ class $AssetsVecGen {
cubeSearchSvg,
cubeTopRotationSvg,
cubeWattingSvg,
damPatternSvg,
diagramSvg,
directPurchaseSvg,
downloadSvg,

View File

@@ -132,6 +132,8 @@ class _RTextFieldState extends State<RTextField> {
late TextDirection textDirection;
Timer? _debounceTimer;
final GlobalKey<FormFieldState<String>> _formFieldKey =
GlobalKey<FormFieldState<String>>();
TextDirection _detectDirection(String text) {
final isPersian = RegExp(r'[\u0600-\u06FF]').hasMatch(text);
@@ -196,13 +198,29 @@ class _RTextFieldState extends State<RTextField> {
return widget.suffixIcon;
}
double _calculateHeight() {
if (!widget.isFullHeight) {
return widget.height;
}
// اگر خطا وجود دارد، ارتفاع اضافی برای نمایش خطا اضافه می‌کنیم
final hasError = _formFieldKey.currentState?.hasError ?? false;
if (hasError) {
// ارتفاع خطا تقریباً 20 پیکسل است (یک خط متن خطا)
return widget.height + 20;
}
return widget.height;
}
@override
Widget build(BuildContext context) {
return SizedBox(
height: (widget.height).h,
height: _calculateHeight().h,
child: Padding(
padding: widget.padding ?? EdgeInsets.zero,
child: TextFormField(
key: _formFieldKey,
textAlignVertical: TextAlignVertical.center,
controller: widget.controller,
focusNode: widget.focusNode,
@@ -210,8 +228,21 @@ class _RTextFieldState extends State<RTextField> {
readOnly: widget.readonly,
minLines: widget.minLines,
maxLines: widget.maxLines,
onChanged: widget.onChanged,
validator: widget.validator,
onChanged: (value) {
widget.onChanged?.call(value);
},
validator: (value) {
final error = widget.validator?.call(value);
if (widget.isFullHeight) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) {
setState(() {});
}
});
}
return error;
},
inputFormatters: widget.inputFormatters,
enabled: widget.enabled,
obscureText: obscure,