Mobile Number Implemented in OTP

This commit is contained in:
2025-09-11 18:13:39 +05:30
parent 0f205873a9
commit 82e057d804
7 changed files with 49 additions and 23 deletions

View File

@@ -5,7 +5,8 @@ import 'package:kmobile/api/services/change_password_service.dart';
import 'package:kmobile/di/injection.dart';
class TpinOtpScreen extends StatefulWidget {
const TpinOtpScreen({super.key});
final String mobileNumber;
const TpinOtpScreen({super.key, required this.mobileNumber});
@override
State<TpinOtpScreen> createState() => _TpinOtpScreenState();
@@ -49,10 +50,9 @@ void _verifyOtp() async {
});
try {
// IMPORTANT: You may need to pass the mobile number here as well
await _changePasswordService.validateOtp(
otp: _enteredOtp,
mobileNumber: '8981274001', // Replace with actual mobile number
mobileNumber: widget.mobileNumber,
);
if (mounted) {
@@ -151,7 +151,6 @@ void _verifyOtp() async {
),
const SizedBox(height: 32),
ElevatedButton.icon(
// Update icon to show a loading indicator
icon: _isLoading
? const SizedBox(
width: 20,