Simple exemple of how to test a http request in a widget test on a button click
this repo is related to this stack overflow post : https://stackoverflow.com/questions/73015849/how-to-spyon-stub-an-http-request-in-a-flutter-widget-test/73043721#73043721
npx degit https://github.com/TheSmartMonkey/flutter-http-widget-test app
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.