paginate<T> method
Implementation
Future<List<T>> paginate<T>(
Future<PaginatedResult<T>> Function(String? nextToken) callback,
) async {
final items = <T>[];
String? nextToken;
do {
try {
final response = await callback(nextToken);
items.addAll(response.items);
nextToken = response.nextToken;
} on DioError catch (ex) {
throw AlgorandException.fromDioError(ex);
}
} while (nextToken != null);
return items;
}