FLUTTER ECOSYSTEM

network_image_mock

Utility for providing mocked Image.network response in Flutter widget tests.

Latest version
2.1.1
30-day downloads
230.3K
Likes
66
Pub points
160

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

A utility package for mocking Image.network responses in Flutter widget tests. It allows developers to simulate network image loading without making actual HTTP requests, ensuring consistent and reliable test results. Ideal for testing UI components that display images from remote sources, it provides a simple way to return placeholder images or predefined assets during testing. The package is lightweight and integrates seamlessly with Flutter's testing framework.

Use cases
  • Testing widgets that display remote images
  • Simulating image loading states
  • Avoiding network calls in unit tests
  • Validating image placeholders
  • Ensuring test consistency
Key features
  • Mock Image.network responses
  • Supports placeholder images
  • No external network dependencies
  • Easy integration with test files
  • Works across all Flutter platforms
Suitable for
  • Flutter developers writing widget tests
  • Teams requiring stable test environments
  • Projects with frequent UI changes involving images
  • Test automation engineers
  • CI/CD pipelines
Considerations
  • Not intended for production use
  • Requires manual setup in test files
  • Limited to image mocking scenarios
  • Does not handle image caching
  • Must be removed from production dependencies
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add network_image_mock

Categories

Source repository

Related projects