getInvoiceItems method
Implementation
@override
Future<Map> getInvoiceItems(String token, String invoiceId,
String? pageNumber, String? pageSize) async {
final String baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
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/invoices/$invoiceId/items$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token", "x-jwt-account-id": "string"},
);
var data = jsonDecode(response.body);
//print(data);
return data;
}