A Flutter sample app that illustrates how to configure and use package:http.
Provide you with example code for using package:http in Flutter, including:
package:provider to pass Clients through an application.MockClient.http_client_factory.dartThis library used to create package:http Clients when the app is run inside the Dart virtual machine, meaning all platforms except the web browser.
http_client_factory_web.dartThis library used to create package:http Clients when the app is run inside a web browser.
Web configuration must be done in a separate library because Dart code cannot import dart:ffi or dart:io when run in a web browser.
main.dartThis library demonstrates how to:
http_client_factory.dart or http_client_factory_web.dart, depending on whether we are targeting the web browser or not.package:http Client by using package:provider.package:http Client methods.widget_test.dartThis library demonstrates how to construct tests using MockClient.