From 66d5dc580b1918db6ed72701e143e50ab1a59f5d Mon Sep 17 00:00:00 2001 From: palash kulshreshtha Date: Sun, 2 Aug 2020 20:02:55 +0530 Subject: [PATCH 1/2] Update pubspec.yaml missing http dependency --- 08_inherited_widgets/pubspec.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/08_inherited_widgets/pubspec.yaml b/08_inherited_widgets/pubspec.yaml index f2336ac..f3d4835 100644 --- a/08_inherited_widgets/pubspec.yaml +++ b/08_inherited_widgets/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.0 - + http: ^0.11.3 + dev_dependencies: flutter_test: sdk: flutter From d85d3effac0de0e55af677ea016996c5fe518c0c Mon Sep 17 00:00:00 2001 From: palash kulshreshtha Date: Sun, 2 Aug 2020 20:04:23 +0530 Subject: [PATCH 2/2] Update main.dart json spelling lowercase --- 08_inherited_widgets/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08_inherited_widgets/lib/main.dart b/08_inherited_widgets/lib/main.dart index ec9e5f3..c04e04c 100644 --- a/08_inherited_widgets/lib/main.dart +++ b/08_inherited_widgets/lib/main.dart @@ -55,7 +55,7 @@ class _NamePageState extends State { // Fetch a name asynchonously over HTTP _get() async { var res = await http.get('https://jsonplaceholder.typicode.com/users'); - var name = JSON.decode(res.body)[0]['name']; + var name = json.decode(res.body)[0]['name']; setState(() => this.name = name); }