TPIN error fixed
This commit is contained in:
@@ -278,7 +278,7 @@ class _StopSingleChequeScreenState extends State<StopSingleChequeScreen> {
|
||||
);
|
||||
if (!mounted) return;
|
||||
final decodedResponse = jsonDecode(response);
|
||||
|
||||
String responseString = response.toString(); // used as the case only for incorrect TPIN
|
||||
final status = decodedResponse['status'];
|
||||
final message = decodedResponse['message'];
|
||||
final code = decodedResponse['code'];
|
||||
@@ -293,12 +293,16 @@ class _StopSingleChequeScreenState extends State<StopSingleChequeScreen> {
|
||||
}
|
||||
_showResponseDialog('Error', errMessage);
|
||||
}
|
||||
if(responseString.contains('INCORRECT_TPIN')){
|
||||
_showResponseDialog('Invalid TPIN',
|
||||
'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.');
|
||||
|
||||
Reference in New Issue
Block a user