Change TPIn #2
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/widgets/pin_input_field.dart'; // Use the new widget
|
||||
|
||||
class ChangeTpinOtpScreen extends StatefulWidget {
|
||||
final String newTpin;
|
||||
const ChangeTpinOtpScreen({super.key, required this.newTpin});
|
||||
|
||||
@override
|
||||
State<ChangeTpinOtpScreen> createState() => _ChangeTpinOtpScreenState();
|
||||
}
|
||||
|
||||
class _ChangeTpinOtpScreenState extends State<ChangeTpinOtpScreen> {
|
||||
final _otpController = TextEditingController();
|
||||
|
||||
void _handleVerifyOtp() {
|
||||
// TODO: Add API call to verify OTP and change TPIN
|
||||
print('Verifying OTP: ${_otpController.text} for new TPIN: ${widget.newTpin}');
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Verify OTP'),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
const Text(
|
||||
'Enter the OTP sent to your registered mobile number.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
PinInputField(
|
||||
controller: _otpController,
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
ElevatedButton(
|
||||
onPressed: _handleVerifyOtp,
|
||||
child: const Text('Verify & Change TPIN'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user