chunk method
Implementation
@override
Future<void> chunk(
int chunk,
void Function(List<Map<String, dynamic>> data) callback,
) async {
try {
int offset = 0;
while (true) {
limit(chunk).offset(offset);
final result = await get();
if (result.isEmpty) {
break;
}
callback(result);
offset += chunk;
if (result.length < chunk) {
break;
}
}
} catch (e) {
rethrow;
}
}