APY integrated without testing...

This commit is contained in:
2026-03-18 12:36:41 +05:30
parent 075cb3aaad
commit 8744e69ef7
29 changed files with 1069 additions and 498 deletions

View File

@@ -23,10 +23,12 @@ class RevokeStopSingleChequeScreen extends StatefulWidget {
required this.toCheque});
@override
State<RevokeStopSingleChequeScreen> createState() => _RevokeStopSingleChequeScreenState();
State<RevokeStopSingleChequeScreen> createState() =>
_RevokeStopSingleChequeScreenState();
}
class _RevokeStopSingleChequeScreenState extends State<RevokeStopSingleChequeScreen> {
class _RevokeStopSingleChequeScreenState
extends State<RevokeStopSingleChequeScreen> {
final _formKey = GlobalKey<FormState>();
final _stopFromChequeNoController = TextEditingController();
final _stopIssueDateController = TextEditingController();
@@ -89,7 +91,7 @@ class _RevokeStopSingleChequeScreenState extends State<RevokeStopSingleChequeScr
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).revokeSingleStopTitle)),
title: Text(AppLocalizations.of(context).revokeSingleStopTitle)),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Form(
@@ -241,7 +243,8 @@ class _RevokeStopSingleChequeScreenState extends State<RevokeStopSingleChequeScr
removeToChequeNo:
_stopFromChequeNoController.text,
removeIssueDate: _stopIssueDateController.text,
removeExpiryDate: _stopExpiryDateController.text,
removeExpiryDate:
_stopExpiryDateController.text,
removeAmount: _stopAmountController.text,
removeComment: _selectedComment == 'Other'
? _otherCommentController.text
@@ -250,31 +253,35 @@ class _RevokeStopSingleChequeScreenState extends State<RevokeStopSingleChequeScr
);
if (!mounted) return;
final decodedResponse = jsonDecode(response);
String responseString = response.toString(); // used as the case only for incorrect TPIN
String responseString = response
.toString(); // used as the case only for incorrect TPIN
final status = decodedResponse['status'];
final message = decodedResponse['message'];
final code = decodedResponse['code'];
if (status == 'SUCCESS') {
_showResponseDialog('Success', message);
} if (status == 'ERROR') {
}
if (status == 'ERROR') {
String errMessage = "error";
if(code == '0172') {
errMessage = 'The selected Cheque is not stopped';
} else if(code == '0748') {
errMessage = 'The selected Cheque is already presented';
if (code == '0172') {
errMessage =
'The selected Cheque is not stopped';
} else if (code == '0748') {
errMessage =
'The selected Cheque is already presented';
}
_showResponseDialog('Error', errMessage);
}
if(responseString.contains('INCORRECT_TPIN')){
if (responseString.contains('INCORRECT_TPIN')) {
_showResponseDialog('Invalid TPIN',
'The TPIN you entered is incorrect. Please try again.');
'The TPIN you entered is incorrect. Please try again.');
}
} on DioException catch (e) {
try {
final errorBodyString =
e.toString().split('Exception: ')[1];
final errorBody = jsonDecode(errorBodyString);
if (errorBody.containsKey('error') &&
final errorBody = jsonDecode(errorBodyString);
if (errorBody.containsKey('error') &&
errorBody['error'] == 'INCORRECT_TPIN') {
_showResponseDialog('Invalid TPIN',
'The TPIN you entered is incorrect. Please try again.');