dependencies

http

<latest_version>

Import the http package.

2. Delete data on the server

This recipe covers how to delete an album from the
JSONPlaceholder using the http.delete() method.
Note that this requires the id of the album that
you want to delete. For this example,
use something you already know, for example id = 1.

The http.delete() method returns a Future that contains a Response.

Future is a core Dart class for working with
async operations. A Future object represents a potential
value or error that will be available at some time in the future.

The http.Response class contains the data received from a successful
http call.

The deleteAlbum() method takes an id argument that
is needed to identify the data to be deleted from the server.

3. Update the screen