network_image_mock icon indicating copy to clipboard operation
network_image_mock copied to clipboard

Could you provide a way to test errorBuilder() of Image.network with this package?

Open jttuboi opened this issue 2 years ago • 0 comments

Hi, I tried to create a test like this, but haven't worked.

await mockNetworkImagesFor(() {
  return tester.pumpWidget(
    MaterialApp(
      home: Image.network('https://this_image_doesnt_exist.png', errorBuilder: (_, __, ___) {
        return const Text('error 404');
      }),
    ),
  );
});

final text = find.text('error 404');
expect(text, findsOneWidget);

I only check when the image is not valid, it shows that Text widget.

jttuboi avatar May 25 '22 13:05 jttuboi