Overview
A Dart package that enables confident mocking of Image.network in Flutter widget tests by leveraging the mocktail package. It simplifies testing UI components that rely on network images by allowing developers to simulate image loading, success, and failure scenarios without making actual HTTP requests. This ensures faster, more reliable, and deterministic tests. The package integrates seamlessly with existing test setups using mocktail, promoting clean and maintainable test code.
Use cases
- Testing widgets with network images
- Simulating image loading states
- Verifying image display logic
- Running tests offline
- Mocking image errors
Key features
- Easy integration with mocktail
- No real network calls
- Supports loading, success, and error states
- Minimal boilerplate
- Works across all platforms
Suitable for
- Flutter developers writing widget tests
- Teams prioritizing test speed and reliability
- Projects using mocktail for mocking
Considerations
- Requires mocktail to be installed
- Not for runtime use
- Limited to Image.network only
- Does not handle image caching
- Test-specific dependency