I have a test which has to load a screen which contains the FlutterMap widget. Unfortunately the test throws an exception because all http calls for the map tile images return a 400 response. I would have to mock a http client that responds with an example image as the body but couldn't find a way to do so. What is the best way to go about this?
Asked
Active
Viewed 18 times
1
-
Please include some code of your current failing test and possibly the screen being tested to make it easier to provide an answer. – Victor Eronmosele Aug 28 '23 at 17:52
1 Answers
0
In the TileLayer
, it should be possible to specify a tileProvider
. In this case, you should be able to use NetworkTileProvider
, as is the default, but it is possible to pass in a custom BaseClient
, if that fits your needs. For more information, see https://docs.fleaflet.dev/layers/tile-layer/tile-providers#network-tile-provider.

JaffaKetchup
- 1,151
- 10
- 26