From 86891db860a75b617c35f68db0fd12a5f536acd6 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sat, 12 Jul 2025 14:46:52 +0330 Subject: [PATCH] fix : delete liner in captcha widget --- .../lib/presentation/widget/captcha/view.dart | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/packages/auth/lib/presentation/widget/captcha/view.dart b/packages/auth/lib/presentation/widget/captcha/view.dart index c94a0db..4b66206 100644 --- a/packages/auth/lib/presentation/widget/captcha/view.dart +++ b/packages/auth/lib/presentation/widget/captcha/view.dart @@ -29,17 +29,18 @@ class CaptchaWidget extends GetView { ), 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 { 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().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