DEV Community

tkpranav for Innovation Incubator

Posted on • Originally published at Medium on

How To Make API Request In Flutter.?

What all we need ….??

  • http package to make the request.
  • dart:convert to process the response from server.

So now let’s make an App that will make API request to get the List of ToDo’s.

And then we will display the first ToDo.

Let’s get into the steps:

1. Creating UI.

Create a ListTile , that will show our ToDo and a button which will make API request.

2. Making Request.

Create a method ,which will make API request.

3. Processing Data.

Now, we have to process the response, so we can use it easily.

4.Updating UI

Update the UI with received data.

5. Functionality

At last, add functionality to the Raised Button

The URL i have used above provides dummy API’s for trial

Also don’t forget to mention the http package in the pubspec.yaml file.

Top comments (0)