create account

Making Http requests and Using Json in Dart's Flutter Framework by tensor

View this thread on: hive.blogpeakd.comecency.com
· @tensor · (edited)
$30.71
Making Http requests and Using Json in Dart's Flutter Framework
#### What Will I Learn?

- You will learn how to make a HTTP GET request in the Flutter framework to get information from an API
- You will learn how to parse Json and then serve it to other parts of your Flutter application
- You will learn how to build List Views and dynamic User Interfaces in Flutter
- You will learn how to make use of the Hot Reload feature in Flutter for iterative development 

#### Requirements

- [IDEA intellij](https://www.jetbrains.com/idea/) or [Visual Studio Code](https://code.visualstudio.com/) with the Dart/Flutter [Plugins](https://github.com/flutter/flutter-intellij)
- The [Dart SDK](https://www.dartlang.org/install) and the [Flutter SDK](https://flutter.io/get-started/install/)
- A fair understanding of Mobile development and Imperative or Object Oriented Programming

#### Difficulty

- Intermediate


#### Description
In this video tutorial, we look at how we can make **HTTP requests** and **Parse JSON** from a **Web API** using **Dart's Flutter Mobile Framework**.   Specifically, we look use an **HTTP GET** request to retrieve data from the **Star Wars API**, [Swapi](https://swapi.co), which we then can serve onto a **List View widget** in our **Flutter Application**.  This style of application is useful because it allows us to serve data without attaching a database to our application or hard-coding the date into our application.  We can also make use of this method to retrieve data from **external APIs** such as the **Google Maps API** or any other public API service.

Our Application makes use of **Dart's Async Isolates** to call the **HTTP request** so that the **User interface** can render while the request is being made.  If the request fails, the User interface still will render properly.  The **HTTP request** grabs ten elements which populates our **List View Widget** and we can chose which properties we want to serve to our **Front-End** from the **JSON**.  We also make use of **Flutter's Hot Reload feature** in this tutorial and show off the **Flutter Visual Studio Code Extensions**. 

The Dart-Code Visual Studio Code Extension can be found [here](https://github.com/Dart-Code/Dart-Code)

The source code for this project can be found [here](https://github.com/tensor-programming/Flutter_calling_api)


#### Video Tutorial
<iframe width="560" height="315" src="https://www.youtube.com/embed/xfdG8e9mgU4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

#### Curriculum

- [Dart Flutter Cross Platform Chat Application Tutorial](https://steemit.com/@tensor/dart-flutter-cross-platform-chat-application-tutorial)
- [Building a Multi-Page Application with Dart's Flutter Mobile Framework](https://utopian.io/u/36304896)    

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tensor/making-http-requests-and-using-json-in-dart-s-flutter-framework">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 12 others
properties (23)
authortensor
permlinkmaking-http-requests-and-using-json-in-dart-s-flutter-framework
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":31792824,"name":"flutter","full_name":"flutter/flutter","html_url":"https://github.com/flutter/flutter","fork":false,"owner":{"login":"flutter"}},"pullRequests":[],"platform":"github","type":"video-tutorials","tags":["utopian-io","steemstem","steemiteducation","technology","science"],"users":["tensor"],"links":["https://www.jetbrains.com/idea/","https://code.visualstudio.com/","https://github.com/flutter/flutter-intellij","https://www.dartlang.org/install","https://flutter.io/get-started/install/","https://swapi.co","https://github.com/Dart-Code/Dart-Code","https://github.com/tensor-programming/Flutter_calling_api","https://steemit.com/@tensor/dart-flutter-cross-platform-chat-application-tutorial","https://utopian.io/u/36304896"],"moderator":{"account":"ewq","time":"2018-03-05T00:48:34.164Z","reviewed":true,"pending":false,"flagged":false},"questions":[{"question":"Is the project description formal?","answers":[{"value":"Yes it’s straight to the point","selected":true,"score":10},{"value":"Need more description ","selected":false,"score":5},{"value":"Not too descriptive","selected":false,"score":0}],"selected":0},{"question":"Is the language / grammar correct?","answers":[{"value":"Yes","selected":true,"score":20},{"value":"A few mistakes","selected":false,"score":10},{"value":"It's pretty bad","selected":false,"score":0}],"selected":0},{"question":"Was the template followed?","answers":[{"value":"Yes","selected":true,"score":10},{"value":"Partially","selected":false,"score":5},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Is the code included in the contribution post or a GitHub repository for the tutorial files, if used?","answers":[{"value":"Yes, the code is included in the post or a GitHub repository","selected":true,"score":5},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Does the sound contain audible speaking and/or music in the background. There must be minimal background noise?","answers":[{"value":" No, the sound is clear","selected":true,"score":5},{"value":"Yes, mildly distracting","selected":false,"score":3},{"value":"Yes, distracting","selected":false,"score":0}],"selected":0},{"question":"Presenter must speak clearly and be easily understandable","answers":[{"value":"Yes, understandable speech","selected":true,"score":5},{"value":"Mostly understandable speech","selected":false,"score":3},{"value":"Mostly not understandable speech","selected":false,"score":0}],"selected":0},{"question":"The title of the tutorial and/or the concepts being covered must be present on the video in text form at all times","answers":[{"value":"Title present on the video at all times","selected":true,"score":5},{"value":"Title is not present on the video at all times","selected":false,"score":0}],"selected":0},{"question":"Concepts covered in the tutorial must be indicated in the post text with brief descriptions of each concept. Text and screenshot images are preferred","answers":[{"value":"Thorough text and images for concepts covered","selected":true,"score":5},{"value":"Minimal text and images ","selected":false,"score":3},{"value":"No or very little text and images ","selected":false,"score":0}],"selected":0},{"question":"Tutorials must address a minimum of three substantial concepts and no more than five","answers":[{"value":"3-5 substantial concepts covered in tutorial","selected":true,"score":5},{"value":"Less than 3 or more than 5 substantial concepts covered in tutorial","selected":false,"score":0}],"selected":0},{"question":"Tutorial videos must be clearly prepared and structured","answers":[{"value":"Presenter is well prepared and video concepts are well structured","selected":true,"score":5},{"value":"Presenter has moments when he/she seems unprepared and/or unstructured","selected":false,"score":3},{"value":"Presenter seems unprepared and/video is unstructured","selected":false,"score":0}],"selected":0},{"question":"Contributors must provide a clear text description of all substantial topics covered in a tutorial video","answers":[{"value":"Text describes concepts clearly with a minimum of 150 words","selected":true,"score":5},{"value":"Text does not describe concepts clearly","selected":false,"score":0}],"selected":0}],"score":99}"
created2018-03-04 23:18:00
last_update2018-03-05 00:48:33
depth0
children7
last_payout2018-03-11 23:18:00
cashout_time1969-12-31 23:59:59
total_payout_value21.635 HBD
curator_payout_value9.078 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,930
author_reputation87,856,203,149,624
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,235,418
net_rshares9,357,729,008,995
author_curate_reward""
vote details (76)
@ewq ·
$1.02
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/uTyJkNm).
**[[utopian-moderator]](https://utopian.io/moderators)**
πŸ‘  , ,
properties (23)
authorewq
permlinkre-tensor-making-http-requests-and-using-json-in-dart-s-flutter-framework-20180305t004836613z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-05 00:48:39
last_update2018-03-05 00:48:39
depth1
children2
last_payout2018-03-12 00:48:39
cashout_time1969-12-31 23:59:59
total_payout_value0.813 HBD
curator_payout_value0.202 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length172
author_reputation2,798,579,990,254
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,248,519
net_rshares251,163,934,326
author_curate_reward""
vote details (3)
@tensor ·
Thank you for moderating my post.
properties (22)
authortensor
permlinkre-ewq-re-tensor-making-http-requests-and-using-json-in-dart-s-flutter-framework-20180305t005431687z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-05 00:54:30
last_update2018-03-05 00:54:30
depth2
children0
last_payout2018-03-12 00:54:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length33
author_reputation87,856,203,149,624
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,249,359
net_rshares0
@utopian.tip ·
Hey @ewq, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
properties (22)
authorutopian.tip
permlinkre-re-tensor-making-http-requests-and-using-json-in-dart-s-flutter-framework-20180305t004836613z-20180305t113059
categoryutopian-io
json_metadata""
created2018-03-05 11:31:00
last_update2018-03-05 11:31:00
depth2
children0
last_payout2018-03-12 11:31:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length153
author_reputation238,310,597,885
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,356,726
net_rshares0
@five34a4b ·
making-http-requests-and-using-json-in-dart-s-flutter-framework-comment
I really like this post tensor!
properties (22)
authorfive34a4b
permlinkmaking-http-requests-and-using-json-in-dart-s-flutter-framework-comment
categoryutopian-io
json_metadata{}
created2018-03-05 00:32:42
last_update2018-03-05 00:32:42
depth1
children1
last_payout2018-03-12 00:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length31
author_reputation1,119,681,610,239
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,246,239
net_rshares0
@tensor ·
I'm glad you enjoyed it.
properties (22)
authortensor
permlinkre-five34a4b-making-http-requests-and-using-json-in-dart-s-flutter-framework-comment-20180305t192710433z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-05 19:27:09
last_update2018-03-05 19:27:09
depth2
children0
last_payout2018-03-12 19:27:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length24
author_reputation87,856,203,149,624
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,449,109
net_rshares0
@steemstem-bot ·
$0.57
<center><a href="www.steemit.com/@steemstem"><img src="https://media.discordapp.net/attachments/384404201544876032/405507994583957505/steemSTEM.png"></a><br><table><tr><th> </th><th> </th><th><a href="https://steemit.com/steemstem/@steemstem/helpful-guidelines-for-crafting-steemstem-content">Guidelines</a></th><th><a href="https://steemit.com/steemstem/@steemstem/steemstem-winter-2017-2018-project-update">Project Update</a></th><th> </th><th> </th></tr></table><br><a href="https://steemit.com/steemstem/@steemstem/being-a-member-of-the-steemstem-community"><b>Being A SteemStem Member</b></a></center>
πŸ‘  
properties (23)
authorsteemstem-bot
permlinkre-making-http-requests-and-using-json-in-dart-s-flutter-framework-20180306t063705
categoryutopian-io
json_metadata""
created2018-03-06 06:37:06
last_update2018-03-06 06:37:06
depth1
children0
last_payout2018-03-13 06:37:06
cashout_time1969-12-31 23:59:59
total_payout_value0.574 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length606
author_reputation3,811,533,615,496
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,555,738
net_rshares142,103,710,580
author_curate_reward""
vote details (1)
@utopian-io ·
$0.05
### Hey @tensor I am @utopian-io. I have just upvoted you!
#### Achievements
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
πŸ‘  
properties (23)
authorutopian-io
permlinkre-tensor-making-http-requests-and-using-json-in-dart-s-flutter-framework-20180305t111027932z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-05 11:10:33
last_update2018-03-05 11:10:33
depth1
children0
last_payout2018-03-12 11:10:33
cashout_time1969-12-31 23:59:59
total_payout_value0.041 HBD
curator_payout_value0.012 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,082
author_reputation152,955,367,999,756
root_title"Making Http requests and Using Json in Dart's Flutter Framework"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,352,794
net_rshares13,398,520,942
author_curate_reward""
vote details (1)