getStatus method

Future<ModelStatus> getStatus()

Get verification status after completion

Implementation

Future<ModelStatus> getStatus() async {
  _ensureAuthenticated();

  try {
    final response = await http.get(
      Uri.parse('$_currentBaseUrl${ApiConstants.statusEndpoint}'),
      headers: _buildHeaders(_authToken!),
    );
    print("Here is the response after getStatus(): ");
    print(jsonDecode(response.body));

    if (response.statusCode == 200) {
      final data = jsonDecode(response.body);
      return ModelStatus.fromJson(data);
    } else {
      throw Exception(
        'Status check failed with status: ${response.statusCode}',
      );
    }
  } catch (e) {
    print('Status check error: $e');
    rethrow;
  }
}