Search code examples
flutterandroid-studioflutter-appbar

My code is not running (flutter) in this part (uri)


This is my code and this part, code is not running I don't know what I do please help me. Thanks. enter image description here


Solution

  • http requires an Uri not an String

    This is the signature of the method

    Future<Response> get(Uri url, {Map<String, String>? headers})
    

    So you should use

    http.get(Uri.parse(url)).then //Your code