The http Package
To make GET requests we need to use the http package. You can find the http package on Dart Pub.
Let’s start by creating a new Flutter app project using:
|||$ flutter create xkcd_app|
and installing the HTTP package by adding the following to pubspec.yaml:
Run flutter packages get to download and install the package if you aren’t using the IDE plugins (which will do it automatically for you after you make changes to pubspec.yaml).
Using the http Package
The HTTP package can be used to make HTTP requests of all kinds.
All of them are asynchronous, which means that, by default, they are ran in a separate thread without affecting the rest of the app’s ...