Created
March 29, 2022 09:36
-
-
Save tauheed0007/c4c7d46fee73b817e573dafa1518b07d to your computer and use it in GitHub Desktop.
by this method we can easily get data from api because now we also have to parse the link with Uri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart';. | |
//dependency | |
http: ^0.13.4 | |
void getData() async { | |
//var url = Uri.parse("https://samples.openweathermap.org/data/2.5/weather?q=London&mode=html&appid=b6907d289e10d714a6e88b30761fae22"); | |
// http.Response response = await http.get(url); | |
Response response = await get(Uri.parse('https://samples.openweathermap.org/data/2.5/weather?q=London&mode=html&appid=b6907d289e10d714a6e88b30761fae22')); | |
//http.Response response = await http.get(url); | |
print(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment