Search code examples
flutterdartflutter-dependenciesflutter2.0

Flutter http 0.13.0 : String can not assign to Uri


I have upgraded http version and getting this type of error.

The argument type 'String' can't be assigned to the parameter type 'Uri'.

Any solution for convert String to Uri?


Solution

  • As per the changelog of http, you need to use Uri.

    You can convert Uri using Uri.parse

    Uri.parse(your_url);