fix : delete liner in captcha widget

This commit is contained in:
2025-07-12 14:46:52 +03:30
parent 0b921fa917
commit 86891db860

View File

@@ -29,17 +29,18 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
),
child: controller.obx(
(state) => Center(
child: Stack(
alignment: Alignment.center,
children: [
CustomPaint(size: const Size(135, 50), painter: _CaptchaLinePainter()),
Text(controller.captchaKey.value ?? 'دوباره سعی کنید', style: AppFonts.yekan24Bold),
],
child: Text(
controller.captchaKey.value ?? 'دوباره سعی کنید',
style: AppFonts.yekan24Bold,
),
),
onLoading: const Center(child: CupertinoActivityIndicator(color: AppColor.blueNormal)),
onLoading: const Center(
child: CupertinoActivityIndicator(color: AppColor.blueNormal),
),
onError: (error) {
return Center(child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)));
return Center(
child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)),
);
},
),
),
@@ -63,21 +64,21 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
validator: (value) {
if (value == null || value.isEmpty) {
return 'کد امنیتی را وارد کنید';
} else if (controller.captchaKey.value != null && controller.captchaKey.value != value) {
} else if (controller.captchaKey.value != null &&
controller.captchaKey.value != value) {
return 'کد امنیتی اشتباه است';
}
return null;
},
onChanged: (pass) {
if(pass.length== 6) {
if(controller.formKey.currentState?.validate()??false) {
if (pass.length == 6) {
if (controller.formKey.currentState?.validate() ?? false) {
Get.find<AuthLogic>().isDisabled.value = false;
}
}
},
style: AppFonts.yekan13,
)
),
),
),
],
@@ -93,22 +94,14 @@ class _CaptchaLinePainter extends CustomPainter {
..color = Colors.deepOrange
..strokeWidth = 2;
final paint2 = Paint()
..color =Colors.blue
..color = Colors.blue
..strokeWidth = 2;
// First line: top-left to bottom-right
canvas.drawLine(
Offset(0, 0),
Offset(size.width, size.height),
paint1,
);
// First line: top-left to bottom-right
canvas.drawLine(Offset(0, 0), Offset(size.width, size.height), paint1);
// Second line: bottom-left to top-right
canvas.drawLine(
Offset(0, size.height),
Offset(size.width, 0),
paint2,
);
// Second line: bottom-left to top-right
canvas.drawLine(Offset(0, size.height), Offset(size.width, 0), paint2);
}
@override