The issue might be related to the fact that the code is running in a web application and modern browsers block HTTP requests from unsecured origins. Try changing the URL to use HTTPS. Additionally, ensure that the code is running in an asynchronous context and the HTTP request is being awaited properly. Use async and await to achieve this. If the problem persists, check the network tab in your browser's developer tools to see if the request is being sent and if there are any errors in the response.
To know more, join our Flutter Training today.