checkJob method

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

Checks the status of a scan job.

host - The host server URL. jobId - The ID of the job to check.

Returns a Map<String, dynamic> containing the job status.

Implementation

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