removeBank method
Implementation
removeBank(BuildContext context, String bankId) async {
try {
isLoading(true);
var request = {
'token': Storage.getValue(Constants.token),
'api_key': Constants.apiKey,
'sub_client_api_key': Storage.getValue(Constants.subClientApiKey),
'bank_id': bankId
};
var response = await DioClient().request(context: context,
api: '/delete-funding-source', method: Method.POST, params: request);
DeleteFundSourceResponse deleteFundSourceResponse =
DeleteFundSourceResponse.fromJson(response);
if (deleteFundSourceResponse.status == Strings.success) {
Utils.showSnackbar(context, Strings.success,
deleteFundSourceResponse.message!, AppColors.green);
} else {
return Utils.showSnackbar(
context, Strings.error, response['message'], AppColors.red);
}
} finally {
isLoading(false);
fetchfundingSources(context);
}
update();
}