From 1b30dafafceeaec3794ca3dc2df9fb713946c2e7 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sun, 18 May 2025 10:21:50 +0330 Subject: [PATCH] fix : captcha and username input type --- .../lib/presentation/pages/auth/view.dart | 2 +- .../lib/presentation/widget/captcha/view.dart | 75 +++++++++---------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/packages/auth/lib/presentation/pages/auth/view.dart b/packages/auth/lib/presentation/pages/auth/view.dart index a495578..90f764c 100644 --- a/packages/auth/lib/presentation/pages/auth/view.dart +++ b/packages/auth/lib/presentation/pages/auth/view.dart @@ -101,7 +101,7 @@ class AuthPage extends GetView { maxLength: 11, maxLines: 1, controller: phoneController.value, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, initText: phoneController.value.text, onChanged: (value) { phoneController.value.text = value; diff --git a/packages/auth/lib/presentation/widget/captcha/view.dart b/packages/auth/lib/presentation/widget/captcha/view.dart index af4d955..d606b7b 100644 --- a/packages/auth/lib/presentation/widget/captcha/view.dart +++ b/packages/auth/lib/presentation/widget/captcha/view.dart @@ -15,40 +15,37 @@ class CaptchaWidget extends GetView { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 135, - height: 50, - clipBehavior: Clip.antiAliasWithSaveLayer, - decoration: BoxDecoration( - color: AppColor.whiteNormalHover, - border: Border.all(color: Colors.grey.shade300), - borderRadius: BorderRadius.circular(8), - ), - child: controller.obx( - (state) => Image.memory( - base64Decode(state?.captchaImage ?? ''), - fit: BoxFit.cover, - ), - onLoading: const Center( - child: CupertinoActivityIndicator(color: AppColor.blueNormal), - ), - onError: (error) { - return const Center( - child: Text( - 'خطا در بارگذاری کد امنیتی', - style: AppFonts.yekan13, - ), - ); - }, - ), - ), GestureDetector( - onTap: controller.getCaptcha, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 3), - child: Icon(CupertinoIcons.refresh, size: 20), - ), - ), + onTap: controller.getCaptcha, + child: Container( + width: 135, + height: 50, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration( + color: AppColor.whiteNormalHover, + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(8), + ), + child: controller.obx( + (state) => + Image.memory( + base64Decode(state?.captchaImage ?? ''), + fit: BoxFit.cover, + ), + onLoading: const Center( + child: CupertinoActivityIndicator(color: AppColor.blueNormal), + ), + onError: (error) { + return const Center( + child: Text( + 'خطا در بارگذاری کد امنیتی', + style: AppFonts.yekan13, + ), + ); + }, + ), + )), + const SizedBox(width: 8), Expanded( child: Form( @@ -65,11 +62,13 @@ class CaptchaWidget extends GetView { maxLines: 1, maxLength: 6, suffixIcon: - (data.value.text.trim().isNotEmpty ?? false) - ? clearButton( - () => controller.textController.value.clear(), - ) - : null, + (data.value.text + .trim() + .isNotEmpty ?? false) + ? clearButton( + () => controller.textController.value.clear(), + ) + : null, onSubmitted: (data) {}, validator: (value) {