I get this error: A value of type 'Future<Response>' can't be assigned to a variable of type 'Response'. Try changing the type of the variable, or casting the right-hand type to 'Response'.
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class loadding extends StatefulWidget {
@override
_loaddingState createState() => _loaddingState();
}
class _loaddingState extends State<loadding> {
void gateData() async {
var url =
Uri.parse('http://worldtimeapi.org/api/timezone/Africa/Addis_Ababa');
//here is The Error occur at http.get(url),
http.Response response = http.get(url);
}
@override
Widget build(BuildContext context) {
return Scaffold();
}
}