FLUTTER ECOSYSTEM

state_notifier_test

A testing library which makes it easy to test StateNotifier. Built to be used with the state_notifier, riverpod or flutter_riverpod packages.

Latest version
0.0.10
30-day downloads
1.8K
Likes
22
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A testing library designed to simplify the testing of StateNotifier classes, compatible with state_notifier, Riverpod, and flutter_riverpod. It provides utilities to easily assert state changes, handle asynchronous updates, and test error conditions. The package integrates seamlessly into Flutter testing workflows, enabling developers to write reliable, maintainable tests for reactive state logic across multiple platforms.

Use cases
  • Testing state transitions in StateNotifier
  • Verifying async state updates
  • Validating error handling in state logic
  • Unit testing Riverpod-based state management
  • Ensuring consistent behavior across platforms
Key features
  • Easy assertion of state changes
  • Support for async state testing
  • Integration with Riverpod ecosystem
  • Minimal boilerplate
  • Cross-platform compatibility
  • Test helper methods for common scenarios
Suitable for
  • Flutter developers using Riverpod or state_notifier
  • Teams prioritizing test reliability
  • Projects with complex state logic
  • CI/CD pipelines requiring robust unit tests
  • Developers writing clean, isolated state tests
Considerations
  • Requires state_notifier, riverpod, or flutter_riverpod
  • Limited to StateNotifier-based state management
  • May need additional setup for complex dependencies
  • Not intended for widget-level integration tests
  • Best used alongside other testing packages like mockito or test
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add state_notifier_test

Categories

Dependencies

Dependency list 5 items

Source repository

Related projects