# mocktail

> Mocks for Dart and Flutter tests without code generation

Source: https://talira.ai/catalog/mocktail-99grf8ee
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / mocking](https://talira.ai/categories/developer-tools/testing/mocking), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Felix Angelov](https://talira.ai/orgs/felangel.md)

mocktail is a mocking library for Dart and Flutter tests, inspired by Dart's mockito package. You create a mock by extending `Mock` and implementing the class, then stub calls with `when(() => ...)` and check them with `verify`, with null safety and no hand-written mocks or code generation step. The same repository has mocktail_image_network, which mocks `Image.network` in widget tests.

## Links

- GitHub: https://github.com/felangel/mocktail

## Problems it solves

- mocking in Dart with mockito means running build_runner to generate mocks
- mock a class in my Flutter unit tests without code generation
- stub and verify method calls in Dart tests

## Features

- mock Dart classes in tests without code generation
- stub calls and verify how often they were made
- null-safe API inspired by mockito
- mock Image.network in Flutter widget tests

## Trust

Overall: 0.34 out of 1.
Signals: maintenance 0.27, adoption 0.57, momentum 0.31, community 0.54, backing 0.30, extensibility 0.00.

- latest release mocktail-image-network-v1.3.0 7 months ago
- 702 GitHub stars
- 22 contributors
- accepts sponsorship (Github)
- backed by Felix Angelov

Warnings:

- last commit 7 months ago

## Alternatives

- [mockito](https://talira.ai/catalog/mockito-pccr92at.md): Mock library for Dart, inspired by Java's Mockito

## Sources

[^1]: https://github.com/felangel/mocktail/blob/main/LICENSE (checked 26 Nov 2026)
