How I use get method with variables in flutter http?

Issue

Error Image Here

I want to call API but I can’t give latitude and longitude as variables.

Solution

basically you would want to define your uri in the getData method.
example:

getData({String latitude,String longitude})async{
..define uri. var url =Uri.https..
http.Response..

Answered By – griffins

Answer Checked By – Senaida (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *