I am writing a function on Flutter, which fetches data from an API. After the function is done, I need to return variable as Future<Response>
Here is the function:
final String apiUrl = "http://api.aladhan.com/v1/calendarByCity?city=Kayseri&country=Turkey&method=13&month=07&year=2021";
Future<Response> fetchData() async {
var result = await http.get(Uri.parse(apiUrl));
return result;
}
However, I get this message from the compiler:
The name 'Response' isn't a type so it can't be used as a type argument.
Try correcting the name to an existing type, or defining a type named 'Response'
Is there any other way to return that variable?
Thank you