Hello friends, recently when I was reading an old article on my website, Then I found that flutter has changed some of its coding pattern. I was working on a flutter application project where I need to parse JSON data from server with HTTP Dark Pub package. But when I ran my old code then It starts showing me couple of errors which I haven’t seen before. So I thought let’s make a complete tutorial on those errors to solve them. It might be helpful for some new flutter developers. So in this tutorial we would learn about Flutter Solve The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’ Error in HTTP Dart Pub package.
Contents in this project Flutter Solve The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’ Error :-
1. First of all below is the screenshot of my Visual Studio code editor where it is showing us the error.
final String uri = 'https://jsonplaceholder.typicode.com/posts';
var response = await http.get(Uri.parse(uri));
This would surely resolve the error. Happy coding friends 🙂 .