I have a problem with an application that is in production. The error occurs specifically on IOS, when the application is minimized for a long time and it is returned. I am creating and closing the client but the error persists. can anyone help?
Future<http.Response> getApi(String url) async {
String? token = await UserStorage.getToken();
var client = http.Client();
try {
var headers = {
'Accept': 'application/json',
'Authorization': 'Bearer $token',
};
var uri = Uri.parse(url);
var response = await client.get(uri, headers: headers);
return response;
} finally {
client.close();
}
}




