'I can't access the response variable in this get function in that dart, what could be it?

 Future<Response> getRequest(String baseUrl) async {
    Response response;
    try {
      response = await _dio.get(baseUrl);
      print('I can\'t print this line');
    } on DioError catch (e) {
      print(e.message);

      throw Exception(e.message);
    }
    return response;
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source