Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where did IOClient go in the Dart http package?

Tags:

http

flutter

dart

I'm working on making http requests from a Flutter project. I have seen several answers refer to IOClient. For example, here and here and here. However, the following imports do not work (though they apparently used to):

import 'package:http/http.dart';
import 'package:http/http.dart' show IOClient;

Instead, the second one gives the error message:

The library 'package:http/http.dart' doesn't export a member with the shown name 'IOClient'.

How do I import IOClient?

like image 491
Suragch Avatar asked Sep 04 '25 17:09

Suragch


1 Answers

IOClient is still in the http package but it is no longer in the http library. It has been extracted into its own library as io_client. You can import it like this:

import 'package:http/io_client.dart';
like image 108
Suragch Avatar answered Sep 06 '25 19:09

Suragch