getImageInfo method

Future<Map<String, dynamic>> getImageInfo(
  1. String host,
  2. String jobId
)

Get metadata for the next scanned image.

host - The host server URL. jobId - The ID of the scan job.

Returns a Map<String, dynamic> containing the image metadata.

Implementation

Future<Map<String, dynamic>> getImageInfo(String host, String jobId) async {
  final url = '$host/api/device/scanners/jobs/$jobId/next-page-info';
  try {
    final response = await http.get(Uri.parse(url));
    return json.decode(response.body);
  } catch (error) {
    return {};
  }
}