getCardHolders method
Implementation
@override
Future<Map> getCardHolders(String token, String? cardholderStatus,
String? pageNumber, String? pageSize) async {
final baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
if (cardholderStatus != null) {
filters.add(cardholderStatus);
prefixes.add("cardholder_status=");
}
if (pageNumber != null) {
filters.add(pageNumber);
prefixes.add("page_num=");
}
if (pageSize != null) {
filters.add(pageSize);
prefixes.add("page_size=");
}
String params = addFilter(filters, prefixes);
var url = Uri.parse("$baseUrl/api/v1/issuing/cardholders$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token"},
);
var data = jsonDecode(response.body);
return data;
}