From 496287716a858a53276fcbd374b6123ce9e32682 Mon Sep 17 00:00:00 2001 From: "Raj.Ghag" Date: Mon, 27 Apr 2026 13:35:17 +0530 Subject: [PATCH] bugs solved and more fixes --- lib/login/view/verify_otp_bottomsheet.dart | 91 ++++++++++++++++++---- lib/networkApiServices/api_urls.dart | 4 +- pubspec.lock | 24 +++--- pubspec.yaml | 2 +- 4 files changed, 89 insertions(+), 32 deletions(-) diff --git a/lib/login/view/verify_otp_bottomsheet.dart b/lib/login/view/verify_otp_bottomsheet.dart index 9fcc7b5..f52de96 100644 --- a/lib/login/view/verify_otp_bottomsheet.dart +++ b/lib/login/view/verify_otp_bottomsheet.dart @@ -9,7 +9,7 @@ import 'package:citycards_customer/profile/bloc/profile/profile_bloc.dart'; import 'package:citycards_customer/profile/bloc/profile/profile_event.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_otp_text_field/flutter_otp_text_field.dart'; +import 'package:pinput/pinput.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../cart/blocs/myPassCart/my_pass_cart_event.dart'; import '../../cart/blocs/myPostcardsCart/my_postcards_cart_bloc.dart'; @@ -142,25 +142,82 @@ class _VerifyOtpBottomsheetState extends State { ), ), SizedBox(height: 15.h), - OtpTextField( - numberOfFields: 6, - borderWidth: 0.4.w, - fieldWidth: 48.w, - fieldHeight: 60.h, - borderRadius: BorderRadius.circular(8.r), - filled: true, - fillColor: const Color(0xFFFFF5F5), - borderColor: const Color(0xFFBB474A), - cursorColor: const Color(0xFFF95F62), - showFieldAsBox: true, - textStyle: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w500, + Pinput( + length: 6, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + defaultPinTheme: PinTheme( + width: 48.w, + height: 60.h, + textStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + decoration: BoxDecoration( + color: const Color(0xFFFFF5F5), + borderRadius: BorderRadius.circular(8.r), + border: Border.all( + color: const Color(0xFFBB474A).withOpacity(0.4), + width: 1.w, + ), + ), ), - onCodeChanged: (code) { + focusedPinTheme: PinTheme( + width: 48.w, + height: 60.h, + textStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.r), + border: Border.all( + color: const Color(0xFFF95F62), + width: 1.5.w, + ), + boxShadow: [ + BoxShadow( + color: const Color(0xFFF95F62).withOpacity(0.1), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + ), + submittedPinTheme: PinTheme( + width: 48.w, + height: 60.h, + textStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + decoration: BoxDecoration( + color: const Color(0xFFFFF5F5), + borderRadius: BorderRadius.circular(8.r), + border: Border.all( + color: const Color(0xFFBB474A), + width: 1.w, + ), + ), + ), + cursor: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only(bottom: 9.h), + width: 20.w, + height: 1.h, + color: const Color(0xFFF95F62), + ), + ], + ), + onChanged: (code) { _otpCode = code; }, - onSubmit: (code) { + onCompleted: (code) { _otpCode = code; debugPrint("OTP entered: $code"); }, diff --git a/lib/networkApiServices/api_urls.dart b/lib/networkApiServices/api_urls.dart index 2e1ee15..67fb456 100644 --- a/lib/networkApiServices/api_urls.dart +++ b/lib/networkApiServices/api_urls.dart @@ -1,8 +1,8 @@ class ApiUrls { // static const baseUrl = "https://devapi.citycards.betadelivery.com";//Normal API - static const baseUrl = "https://testingapi.citycards.betadelivery.com";// Test API - // static const baseUrl = "https://uatapi.citycard.betadelivery.com";// Production Lvl API + // static const baseUrl = "https://testingapi.citycards.betadelivery.com";// Test API + static const baseUrl = "https://uatapi.citycard.betadelivery.com";// Production Lvl API static const refreshToken = "$baseUrl/auth/refresh"; diff --git a/pubspec.lock b/pubspec.lock index c494088..d0fbdc6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -395,14 +395,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.7" - flutter_otp_text_field: - dependency: "direct main" - description: - name: flutter_otp_text_field - sha256: e7e589dc51cde120d63da6db55f3cef618f5d013d12adba76137ca1a51ce1390 - url: "https://pub.dev" - source: hosted - version: "1.5.1+1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -801,10 +793,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.18" material_color_utilities: dependency: transitive description: @@ -957,6 +949,14 @@ packages: url: "https://pub.dev" source: hosted version: "9.0.20" + pinput: + dependency: "direct main" + description: + name: pinput + sha256: "4c3f1b84768b47a56a1abdaca551bd7cef4ac673b882209039ecdf803a5d6e68" + url: "https://pub.dev" + source: hosted + version: "6.0.2" platform: dependency: transitive description: @@ -1278,10 +1278,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.9" three_js: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 76e2c97..9d77b01 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: intl: ^0.20.2 image_picker: ^1.2.0 image: ^4.5.4 - flutter_otp_text_field: ^1.5.1+1 + pinput: ^6.0.2 google_maps_flutter: ^2.13.1 geolocator: ^14.0.2 equatable: ^2.0.8