Add the http package.

Make a network request using the http package.

Convert the response into a custom Dart object.

Fetch and display the data with Flutter.

1. Add the http package

The http package provides the
simplest way to fetch data from the internet.

To install the http package, add it to the
dependencies section of the pubspec.yaml file.
You can find the latest version of the
http package the pub.dev.

dependencies

http

<latest_version>

Import the http package.

Additionally, in your AndroidManifest.xml file, 
add the Internet permission.

<!-- Required to fetch data from the internet. -->

<uses-permission

android:name=

"android.permission.INTERNET"

/>

2. Make a network request