From a2ef53f7106965ac516e141751f44d62079d290b Mon Sep 17 00:00:00 2001 From: Mohammad Salim Date: Fri, 5 Mar 2021 23:01:23 +0300 Subject: [PATCH] Update networking.dart The http.get of the new http library doesnt support url as an input but it asks for Uri object. --- lib/services/networking.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/services/networking.dart b/lib/services/networking.dart index eded3ee..c3ca53e 100644 --- a/lib/services/networking.dart +++ b/lib/services/networking.dart @@ -4,7 +4,12 @@ import 'dart:convert'; class NetworkHelper { NetworkHelper(this.url); - final String url; + final url = new Uri.https( + "samples.openweathermap.org", "/data/2.5/weather", { + "lat": "35", + "lon": "139", + "appid": "439d4b804bc8187953eb36d2a8c26a02" + }); Future getData() async { http.Response response = await http.get(url);