FLUTTER ECOSYSTEM

mocktail_image_network

A Dart package which allows you to mock Image.network in your widget tests with confidence using the mocktail package.

Latest version
1.3.0
30-day downloads
102K
Likes
64
Pub points
160

Package Overview

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

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
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add mocktail_image_network

Categories

Source repository

Related projects

Rankings