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?
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';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With