DEV Community

tkpranav for Innovation Incubator

Posted on • Originally published at Medium on

1

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.


Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay